Webmaster Forums - Website and SEO Help

Web Development and Design => Database, Server, Coding and Website Administration => Topic started by: Webhelpforums on April 27, 2010, 09:17:50 AM

Title: Rediect using htaccess mod_rewrite on Apache
Post by: Webhelpforums on April 27, 2010, 09:17:50 AM
If you have multiple domains pointing to same site or just problems with with-www versus non-www URLs you can use this:


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