Click to See Complete Forum and Search --> : Mod_Rewrite to exisiting .htaccess file


Sculleybe
06-02-2011, 05:51 AM
I want to add this code to an already existing .htaccess file to make all non-www URLs to go to their www version to protect against duplicate content issues with Google:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}!
^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1
[L,R=301]
<IfModule>

The exisiting .htaccess file has about 50 lines of permanent redirects like so:
Redirect permanent /BeingPresent.html http://www.domain.org/folder/file.html

How do I add the mod rewrite to the .htaccess file safely and correctly? I tried just adding it and it gave me an error message.

Also, this is for a .org domain so I would assume this line would change to:
^www\.equinection\.org [NC]

Is that correct?


Thanks so much in advance!