Neil Thompson
asked on
rewrite a subdomain to a path using Apache?
Hi
I've been asked if I can rewrite an address using Apache 2.2
I'm trying to get and of these
members|intranet|email to become the path after a preset domain, whatever http or https method used initially should also follow through
eg.
http://members.bbb.co.uk should re-write to http://www.bbb.co.uk/members
https://members.bbb.co.uk should re-write to https://www.bbb.co.uk/members
and so on
I think I need something like this but not really sure what I am doing here:
#RewriteRule ^(members|intranet|email)( ?:/(.*))?$ https://aa.bbbbbbb.co.uk/$1 [P]
Thanks in advance
I've been asked if I can rewrite an address using Apache 2.2
I'm trying to get and of these
members|intranet|email to become the path after a preset domain, whatever http or https method used initially should also follow through
eg.
http://members.bbb.co.uk should re-write to http://www.bbb.co.uk/members
https://members.bbb.co.uk should re-write to https://www.bbb.co.uk/members
and so on
I think I need something like this but not really sure what I am doing here:
#RewriteRule ^(members|intranet|email)(
Thanks in advance
On my site it looks like this.
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^members http://members.bbb.co.uk/
RewriteCond %{HTTPS} =on
RewriteRule ^members https://members.bbb.co.uk/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks , spot on
http://www.bbb.co.uk/members should re-write to http://members.bbb.co.uk
https://www.bbb.co.uk/members should re-write to https://members.bbb.co.uk