: .htaccess mod_rewrite domain to subdomain I need to redirect any domain to a sub-domain. I know this has got to be possible but for the life of me i can not figure it out. Any help is appreciated.
I need to redirect any domain to a sub-domain. I know this has got to be possible but for the life of me i can not figure it out. Any help is appreciated.
For example:
domain1.com
domain2.com
subdomain1.domain1.com
subdomain2.domain2.com
all go to subdomain3.domain.com
but i need code that does not require me to enter each domain i want redirected. So for any feature domains that i link or create will go to subdomain3.domain.com btw this will only happen when viewing anydomain.com/path <-- the path is a sym link
More posts by @Vandalay111
1 Comments
Sorted by latest first Latest Oldest Best
I’m not sure if I understand your question right. If you want to redirect all requests to path to subdomain3.example.com just compare the hosts:
RewriteCond %{HTTP_HOST} !^subdomain3.example.com$
RewriteRule ^path subdomain3.example.com/ [L,R=301]
Update
RewriteCond %{HTTP_HOST} !^subdomain3.example.com$
# At least one character after /
RewriteRule (.+) subdomain3.example.com/ [L,R=301]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.