/ Published in: Apache

This is if you have multiple domains pointed to the same directory on a server.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^secondarydomain1.com$ [OR] RewriteCond %{HTTP_HOST} ^www.secondarydomain1.com$ RewriteRule (.*)$ http://www.primarydomain.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^secondarydomain2.com$ [OR] RewriteCond %{HTTP_HOST} ^www.secondarydomain2.com$ RewriteRule (.*)$ http://www.primarydomain.com/$1 [R=301,L]
Comments
