Forum Moderators: phranque

Message Too Old, No Replies

httpd.conf and index.html

removing index.html using httpd.conf

         

berrysharpie

10:29 pm on Jun 22, 2007 (gmt 0)

10+ Year Member



Hi,

Up until today my site was indexed as www.my-site.com by google and was always listed first in the "site:" index. Today I noticed it changed to www.my-site.com/index.html and it is now the second page listed in the "site:" index. The PR has not changed so is it even worth getting rid of the /index.html?

How can I remove the "index.html" using httpd.conf without hurting what google already has indexed and hurting my rankings?

We want to do a 301 to be safe and have reviewed previous posts. So far this is what we have tried to work with:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html
RewriteRule ^index\.html$ http://www.example.com/ [R=301,L]

We also tried the RedirectPermenant but got ourselves stuck in a loop. (As also reported on previous posts)

This does not work when we put it in our httpd.conf file!

Can someone please help!

BerrySharpie

[edited by: encyclo at 8:17 pm (utc) on June 23, 2007]
[edit reason] switched to example.com [/edit]

jdMorgan

10:24 pm on Jun 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That code was written for use in .htaccess, and will need to be modified for use in httpd.conf:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html
RewriteRule [b]^/i[/b]ndex\.html$ http://www.example.com/ [R=301,L]

Jim

berrysharpie

10:38 pm on Jun 23, 2007 (gmt 0)

10+ Year Member



Thanks jdMorgan, I will give that a try!