Hi Guys, I am trying to redirect my www links to the non-www version. I am using the code below, but I am not sure it's correct because I'm having trouble getting indexed properly. Please confirm. Thanks! RewriteCond %{HTTP_HOST} !^example\.com$ [NC] RewriteRule ^(.*) http://example.com/$1 [L,R=301]
Explain your indexing problem. Your code looks correct...when you go to www.yoursite.com, you get redirected to yoursite.com, right? So the redirection is working correctly.
Yes. The redirect works from the non-www to the www. I thought maybe the redirect was in error, causing my site not to get indexed. However, I think the reason for the poor indexing is due to the same metatags throughout the site, which I have now changed. Thanks for confiming that the redirect is ok.