: Mod_rewrite problems - redirect subdomain to different domain I must have a brain freeze as I can not get my rewrite rules working. RewriteEngine On RewriteCond %{HTTP_HOST} ^otherdomain.example.com
I must have a brain freeze as I can not get my rewrite rules working.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^otherdomain.example.com [NC]
RewriteRule ^(.*) www.otherdomain.com/ [R=permanent,L]
RewriteCond %{HTTP_HOST} ^(www.)?example.com [NC]
RewriteCond %{REQUEST_URI} ^/otherdomain [NC]
RewriteRule ^(.*) www.otherdomain.com/ [R=permanent,L]
What I want is essential to redirect
otherdomain.example.com and example.com/otherdomain to otherdomain.com
More posts by @Martha676
1 Comments
Sorted by latest first Latest Oldest Best
Just use the below redirection. will work 100%. Because I personally use it for my website....
RewriteCond %{HTTP_HOST} ^subname.old-main-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.subname.old-main-domain.com$
RewriteRule ^(.*)$ "http://www.newdomain.com/" [R=301,L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.