You may have been redirected here beause you are using a very old browser. This page explains what your browser was trying to do and why it isn't right.
For a long, long time now I've been seeing strange 404 errors in my logs and I simply could not imagine what was causing them. The symptoms were always the same: someone would read a page, and then they'd try to read a page that was constructed from the page title (the text actually between the <title> </title>tags). I'd see something like this in my logs:
184.108.40.206 - - [10/Dec/2007:11:14:47 +0000] "GET /Basics/Permissions_files/nslate.css HTTP/1.1" 404 6823 "https://aplawrence.com/Basics/perms.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" 220.127.116.11 - - [10/Dec/2007:11:14:47 +0000] "GET /Basics/Permissions_files/reset-fonts-grids.css HTTP/1.1" 404 6832 "https://aplawrence.com/Basics/perms.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)"
and my error log would have:
[Mon Dec 10 11:14:47 2007] [error] [client 18.104.22.168] File does not exist: /usr/local/www/vhosts/vps.pcunix.com/htdocs/Basics/Permissions_files, referer: https://aplawrence.com/Basics/perms.html
I hate error log entries. Simply cannot stand 'em. Yes, some are unavoidable: if someone out in the netosphere mistypes a link to my site, I'm going to have a log entry. OK, I can live with that. but these aren't mistypes. These are somebody's programming error - maybe mine, maybe someone else, but whatever it is, I need to understand it and fix it if I can.
Last night when I went to bed I told myself that I would solve this annoying problem the next day no matter what. So this morning I got up early and started looking at log files again. Was there any pattern to these errors that might give me a clue?
Why yes there was: every one of these had "MSIE 6.0" in the browser field. And that's when I finally noticed that every one of them also had appended "_files" to the title tag. Duh! When do you see "_files"? When you download a file, saving it locally!
Of course! These come from people saving the web page to their own machines, and IE 6.0 apparently has some stupid broken code (yay Microsoft - again!) that screws up and causes these errors.
Okey dokey. Mystery solved, it's Microsoft Internet Explorer 6.0 that is filling up my error logs. I guess it surprises me a little how many people are saving local copies, but mostly I just want to fix the error. Since I can't make them upgrade their browsers, I need to rewrite their requests, so that's a job for .htaccess (see using .htaccess files to redirect pages). But what am I going to do with the requests? I'm afraid to redirect them to any normal page for fear they'll get into a loop. So instead, I created a file called "safedown.html" which only contains this:
<html><head> </head> <body> You need to upgrade your browser </body></html>
Then, in /.htaccess, I added these lines:
RedirectMatch permanent .*_files$ /safedown.html RedirectMatch permanent .*_files.*css$ /safedown.html
The first line probably isn't necessary.. I think the actual source of this is IE misinterpreting "@import" lines, but I added it just in case. I could leave off the trailing $, but unfortunately i have legitimate files with "_file" as part of their name.
That fix should eliminates errors from my logs, and coincidentally gives me an easy way to count how many local file saves happen just by counting "safedown.html". It shouldn't affect their download in any way - they'll probably never even look at the file I sent them to.
Make sure to read the comments as there may be other ways to fix this.
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2011-03-25 Anthony Lawrence
It all sounds good from the pulpit,but come Monday morning all the sinners are back to business as usual writing crappy code. (Tony Lawrence)