Forum Moderators: phranque

Message Too Old, No Replies

rewrite or redirect to point to www version

         

esllou

10:39 pm on Mar 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



now in my .htaccess, I am using

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

would it be better to use Redirect or does the R=301 cover that?

I want the non-www version to drop out of the search engines altogether if possible.

[edited by: engine at 1:17 pm (utc) on Mar. 31, 2005]
[edit reason] examplified [/edit]

enotalone

11:48 am on Mar 31, 2005 (gmt 0)

10+ Year Member



it shoudl take care of that and do 301 redirect which i have been using for a year i think and works just fine.

mod rewrite i am using is little different than what you have.

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

[edited by: engine at 1:17 pm (utc) on Mar. 31, 2005]
[edit reason] examplified [/edit]