Forum Moderators: phranque

Message Too Old, No Replies

.htaccess messing up ranking?

.htaccess hurting my ranking

         

gbgamblers23

11:41 pm on Feb 19, 2009 (gmt 0)

10+ Year Member



Ever since i implemented my .htaccess file my sites dropped to a point that i can't even find it on google.

Can anyone notice something about my .htaccess file that could be the cause of this?

Options -Indexes

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]

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


ErrorDocument 404 /error.html

jdMorgan

5:24 am on Feb 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your second rule makes the first rule completely redundant. You can remove the first rule set entirely without changing the results.

Your second and third rules are in the wrong order.

The literal periods in all of the regular-expressions patterns should be escaped, as in "!^www\.example\.com$" An un-escaped period in a regular-expressions pattern is interpreted as a regex token meaning "match any single character at this position"

However, none of these errors are sufficiently-serious to cause ranking problems unless you link to "index.html" in the non-canonical domain from within your own site. If you do do that, then the result will be two sequential 301 redirects -- The first to canonicalize the domain to "www.example.com" and the second to redirect "index.html" to "/". Search engines typically pass page ranking credit through a single 301 redirect, but may not do so if there are two sequential redirects.

If you just installed these rules and are changing from non-www links (or from a mixture of www and non-www links) to www.example.com links on your site, then you may need to allow time --anywhere from several days to several months-- for search engines to find and follow the redirects and to assign the PageRank/link-popularity of the old URLs to the new URLs. This temporary drop would not be the result of the code, though. It is the result of changing the URLs on you pages.

Jim

gbgamblers23

6:06 am on Feb 20, 2009 (gmt 0)

10+ Year Member



thanks jim, on my site my internal links all link to index.html . Are you saying this could possibly be a problem? If so would you recommend i change all the internal links to / or the complete address at [site.com...] ?

gbgamblers23

6:06 am on Feb 20, 2009 (gmt 0)

10+ Year Member



thanks jim, on my site my internal links all link to index.html . Are you saying this could possibly be a problem? If so would you recommend i change all the internal links to / or the complete address at [site.com...] ?

jdMorgan

7:21 pm on Feb 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Linking to "/index.html" is not a ranking problem, it is simply unnecessary. It results in a longer, uglier, harder-to-type URL. Some search engines prefer to list "/" in their results, and their robots will request that URL -- apparently even if there are no links to it on the Web.

So using index.html is not likely to be the problem, and I would defer making any URL changes on your site until you find the real cause of the problem, and can strengthen the site's ranking; Changing the URLs on a weak site will make it weaker, and slow the search ranking 'recovery process' of passing the PageRank/link-popularity of the old URLs to the new ones.

I'd be looking at basic inbound linking (quantity, relevance, and quality) and on-page factors for the reason for your ranking troubles, because there is/was nothing fatally wrong with your code; It was simply not optimal.

Jim