redirect from non www to www

Status
Not open for further replies.

ge0

Active Member
613
2010
37
0
Hi

I have wordpress website hosted as example.com and now i want it to be www.examples.com i want the www version to load everytime

i did it from wordpress setting but creating a lot of crawl issue -- Is it fine doing this way ??

I also tried writing the re write rule
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

But only the homepage is re directed to www.example.com other pages giving 404 error
and cpanel redirect is not working
Please help me

what should i do
 
3 comments
this is what i used
Code:
##Redirect non-www to www:
#RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
#RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
 
Google webmaster tool only allow you to confirm to google only about your prefered domain
Your site non-www version will not redirect to the www version
You need to do
Code:
##Redirect non-www to www:
#RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
#RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Google and other search engines will update their listing within 24hrs
 
Status
Not open for further replies.
Back
Top