I was analyzing my webpage SEO using an online tool where I saw that my HTTP status for my root domain name www.example.com
was resulting in a 301 redirect to www.example.com/index.html
.
I would much rather have my root domain returning a 200 result instead- but I set up my 301 redirects a long time ago and now I am not sure how to alter my code to resolve this. I have noticed my website's main root domain disappearing from the SERPs (being replaced, in most cases, with a sub domain page) and I am afraid that this 301 redirect may be affecting my root domain's ability to rank.
My .htaccess
file begins with this code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Followed by my individual redirects.
My index.html
page includes the code:
<link rel="canonical" href="http://www.example.com">
And I have Google webmaster tools set up to have any instances of non-www pages show up as their www version instead.
Is any of this code redundant? What should I change in order to get a HTTP 200 result for my root?
http://yourdomain.com/
he still will be redirected to a proper domain first.