Skip to content

Redirect multiple domains to one

When a site is available under multiple domains, it is usually bad idea to not have them all redirect to one domain. In apache, do this:

RewriteEngine On
RewriteCond %{HTTP_HOST}   !=www.domain.com
RewriteRule ^(.*)$         http://www.domain.com$1 [L,R=permanent] 

    No Comments ( Add comment / trackback )

    Post a comment

    (required)
    (required)

    Your email is never published nor shared.

    (optional)
    Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>