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?