Return to Snippet

Revision: 30772
at August 21, 2010 07:08 by batfan


Initial Code
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]

Initial URL


Initial Description
This is if you have multiple domains pointed to the same directory on a server.

Initial Title
HTACCESS - Redirect Secondary Domains to Primary Domain

Initial Tags
htaccess

Initial Language
Apache