Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I was analyzing my webpage SEO using an online tool where I saw that my http status for my root domain name www.caliberequipment.com was resulting in a 301 redirect to www.caliberequipment.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 note 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} ^caliberequipment.com [NC] 
RewriteRule ^(.*)$ http://www.caliberequipment.com/$1 [L,R=301]

Followed by my individual redirects.

My index.html page includes the code:

<link rel="canonical" href="http://www.caliberequipment.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?

share|improve this question
    
@LazyOne So should I instead have my .htaccess include that line "RewriteRule ^$ /index.html [L]" at the end or should I replace my last two lines? Thank you! <3 –  Virage Jun 17 '11 at 21:22
    
Add it at the end. In this case if someone hits http://yourdomain.com/ he still will be redirected to a proper domain first. –  LazyOne Jun 17 '11 at 21:26
    
Great! I just implemented and it works perfectly, getting a 200 status now! Thanks so much again :D –  Virage Jun 17 '11 at 21:32
add comment

1 Answer

up vote 4 down vote accepted
RewriteRule ^$ /index.html [L]

This will tell Apache to treat the hit to the yoursite.com as hit to yoursite.com/index.html without redirecting (URL stays the same).

The code you already have (last 2 lines) tells Apache to redirect not www-prefixed url to one with www in front (e.g. http://yourdomain.com/somepage.html => http://www.yourdomain.com/somepage.html).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.