movieprodw
asked on
htaccess rewrite all domains to new domain
Hello,
I have 40 domains that point to one domain but they keep their domain names in tact, I want to change that.
Currently I have it so:
domain1.com
domain2.com
domain3.com
show their domain names but actually load
domain.com
I want the htacess to say
if domain.com then nothing, if not domain.com then change the domain name to domain.com and leave the other info in the url
ie
if domain1.com/search/test.ph p
then rewrite domain.com/search/test.php
I have 40 domains that point to one domain but they keep their domain names in tact, I want to change that.
Currently I have it so:
domain1.com
domain2.com
domain3.com
show their domain names but actually load
domain.com
I want the htacess to say
if domain.com then nothing, if not domain.com then change the domain name to domain.com and leave the other info in the url
ie
if domain1.com/search/test.ph
then rewrite domain.com/search/test.php
ASKER
what if they all use the same htacess, will that create a loop?
No. You will not have this rewrite rule in the VirtualHost for domain.com.
ASKER
Okay, but I don't have a vitualhost for them, they are just pointed by dns, so there is only one htacess file and one index.php file so I need to make it so if it is domain.com then great, if not then redirect to domain.com/xxxx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Open in new window