Forum Moderators: phranque

Message Too Old, No Replies

Common Rewrite Issues

Have you checked your Server Headers?

         

pageoneresults

1:47 pm on Feb 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Over the past few years I've become heavily involved with the technical side of things when it comes to page quality. I've performed an untold number of page quality checks. Part of that process includes checking server headers which is the very first thing I do.

During that time, I've run across a host of Common Rewrite Issues that many have overlooked. Here is just a small listing of those...

  1. No 301 from non www to www or vice versa
  2. 302 from non www to www or vice versa
  3. 404 returning a 200
  4. 301 and 302 looping
  5. Failure to append trailing forward slash where applicable
  6. Misconfigured 404 causing entire site to return a 404 but display fine in the browser

The above are just a few of the more common ones I've come across. It would be nice to build a definitive categorized list of the most Common Rewrite Issues that we would be faced with from both an Apache and Windows perspective. Us Windows folks have a few things working against us out of the box.

In reference to #5, using this example...

www.example.com/sub/

If I remove that trailing forward slash and request the URI again, the server should append the trailing forward slash (a 301).

What I've found in a Windows environment is that you need to account for this when rewriting URIs. If you don't, your going to end up with a mess on your hands as /sub and /sub/ will be returning 200s causing duplication. /sub and /sub/ are two distinct URIs.

jdMorgan

2:34 pm on Feb 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The single most common problem I see on Apache is servers returning a 302-Found when a 404-Not Found or a 410-Gone response is desired.

Mostly this is caused by people implementing custom error pages without reading the Apache ErrorDocument directive documentation [httpd.apache.org] thoroughly. In that documentation, it clearly states that if a full URL is given for the ErrorDocument, then a redirect will be invoked.

Just for clarity, here are two examples, incorrect and correct:

Incorrect (returns 302-Found redirect)

 ErrorDocument 404 http://example.com/error404.shtml

Correct (returns 404-Not Found response)
ErrorDocument 404 /error404.php

Who knows how many Web sites have disappeared from search due to this simple error because the Webmaster "didn't have time to read all those documentation details"...

Jim

pageoneresults

1:11 am on Feb 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



jd, thanks for your support homey!

I'm surprised this topic didn't garner a bit more discussion as this is probably one of the biggest problems that dynamic sites are faced with.