0

we want a subdomain to the register form.

The project is a Code Igniter website.

Our idea is to use register.domain.com

I'm trying to build a rewrite rules to make this.

If the domain is 
    register.domain.com/whatever 
go to 
    register.domain.com/register/form
if the domain is 
    register.domain.com/register/form
do nothing.

Now I only get a infinity looping.

thanks

Oscar

Oskar Calvo
  • 584
  • 1
  • 6
  • 22

2 Answers2

1

I got the easy way.

 RewriteEngine On
 RewriteCond %{REQUEST_URI} ^register.domain.com$ [NC]
 RewriteCond %{REQUEST_URI} !^register.domain.com/register/form [NC]
 RewriteRule ^(.*)$ http://register.domain.com/register/form r [L,R=301]

The ! is "ISNOT" :)

Oskar Calvo
  • 584
  • 1
  • 6
  • 22
0

Try this, i hope it is what you need

With RedirectMatch

RedirectMatch ^/(.*)/ http://new.example.com/docs/$1

EDIT:

I saw you need a condition so:

 <If "%{REQUEST_URI} != '/register/login'">
  RedirectMatch ^/(.*)/ http://new.example.com/docs/$1
 </If>

FINALLY:

RewriteBase /
RewriteEngine On
RewriteCond  %{REQUEST_URI} !^/register/
RewriteCond  %{REQUEST_URI} ^/.+

RewriteRule  ^(.*)/ /register/ [R,L]
rafinskipg
  • 509
  • 5
  • 10