htaccess causes 404 to go wild!

They have: 13 posts

Joined: Oct 2003

Can someone advise me here? When I put a custom 404 error page on my website, and call it with .htaccess, I appear to be swamped by such errors. Here is the top line in my stats:

4878: 1.03%: 24/Oct/03 14:18: /_vti_bin/error404.htm

(My errror page is named error404.htm but resides in the top-level directory.)

Though the bandwidth is not horrendous at 1 percent of the bytes served yesterday, still the number of requests at 4900 is nearly seven times the next-most-popular item, which is my css style sheet!

What's going on here?

Two days ago, when I first put up the .htaccess file, I also got a large (not huge) number of 404 errors to one particular non-existent page. I figured that somebody had linked me to that page (an extension of one that does exist), so I created the subdirectory called for in that request, and put a file in it by the appropriate name. Dunno if this was a wasted effort or not. There were no such errors in yesterday's stats.

I had a similar experience a month ago when I first tried to put up a custom 404 error page.

Appreciate any comments!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

1. put a redirect for all non-existent pages to your front page or something

2. make sure you're not using relative urls (use http://yourdomain.com/page.html et cetera) as (badly written) spiders get caught in them on occasion.

3. what is the code you're using for the 404 in the .htaccess?

They have: 13 posts

Joined: Oct 2003

1. put a redirect for all non-existent pages to your front page or something

I did this for the one obvious case.

2. make sure you're not using relative urls (use http://yourdomain.com/page.html et cetera) as (badly written) spiders get caught in them on occasion.

Oh dear. I have thousands of relative urls on my site. Is that the problem?

3. what is the code you're using for the 404 in the .htaccess?

ErrorDocument 404 error404.htm

Many thanks - Dan

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

no no, I mean only on your 404 page. Smiling Relative links aren't a problem, just for the 404 page itself.

Also, you need to have the full url for your 404 page:

ErrorDocument 404 http://www.yourdomain.com/error404.htm

They have: 13 posts

Joined: Oct 2003

Suzanne wrote: no no, I mean only on your 404 page. Smiling Relative links aren't a problem, just for the 404 page itself.

Also, you need to have the full url for your 404 page:

ErrorDocument 404 http://www.yourdomain.com/error404.htm

Thank you, Suzanne. Will fix forthwith! - Dan

They have: 13 posts

Joined: Oct 2003

Helas, I only made matters worse by using the full url. I began to get infinite regressions, so instead of one call repeated 23,000 times, I got fewer calls of such things as http://www.yourdomain.com/www.yourdomain.com/www.yourdomain.com/error404.htm

So I deleted the 404 call from htaccess.

Sigh!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

cubdriver wrote: Helas, I only made matters worse by using the full url. I began to get infinite regressions, so instead of one call repeated 23,000 times, I got fewer calls of such things as http://www.yourdomain.com/
www.yourdomain.com/www.yourdomain.com/error404.htm

So I deleted the 404 call from htaccess.

Sigh!

Would you please post what you had, exactly? Turn off the "automatically parse URLS" bit when you post.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.