Forum Moderators: phranque

Message Too Old, No Replies

"File does not exist" 404 error for a URL that does 301 redirect

         

1script

6:40 pm on Oct 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm seeing a TON of 404 errors in my cPanel error logs that go something like this (irrelevant fields removed):

File does not exist: /home/example/public_html/tools


Note lack of forward slash "/" at the end because if there was a forward slash, it would have been a proper URL, i.e.

http://www.example.com/tools/ is good but

http://www.example.com/tools is not good but 301-redirects via a rule in .htaccess back to "/tools/"

"tools" is not an actual physical directory, it's just an URL that creates a listing via a rule in .htaccess that invokes a PHP script, and there are further content pages like /tools/1.html, /tools/2.html etc.

Since the error logs contain referrer fields, I went to check on a large number of those referral pages (all on my site) and found no link to "/tools" (no ending slash) and a couple of links to "/tools/" in the HTML code.

"tools" is not the only "virtual directory/listing" that behaves this way. I have a few similar ones on this site.
This 404 error is only logged for roots of these "directories" - it never tries if a physical file named /tools/1.html exists, only if directory named /tools does.


So, does anyone have an idea about why Apache 2.2 would try if the directory exists and generate a 404 error before eventually (correctly) using the relevant rule from .htaccess?

1script

7:07 pm on Oct 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Upon further investigation, it's even more bizarre than that. I can't tell why cPanel shows this error this way but the actual raw Apache log looks like this:

"GET /tools/theme/default/style.css HTTP/1.1" 404 994
(irrelevant fields removed)

Not only a physical directory called /tools/ does not exist on that server, but, more importantly, there is no mentioning of theme/default/style.css style sheet anywhere within HTML code of any of my pages.

This looks like a request for WordPress's default theme's CSS file but this site is not a blog and has never been. The referrer field on this request contains a URL from my site, so you'd think I should see a mentioning of this bad URL within my own HTML code, but it just isn't there!

My own Live Headers (Firefox) shows no request for this file but seemingly ever other visitor of the site tries to request it. Interestingly, it's normally requested 2-3 times or more just before a request for favicon.ico, which seems to be always a last one.

Is there some kind of a plugin (the error shows up for most UAs except maybe Opera) that tries to fetch /theme/default/style.css from every site people visit? Is it a security issue of some sort?

I'm out of ideas on this one, would appreciate any comment!