APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Eliminate 404 errors for title_files

© December 2007 Anthony Lawrence

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: - - [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)" - - [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] File does
not exist:
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.

At first, I thought it had to be me. There's a lot of behind the scenes Perl and Javascript that creates these pages, and I wrote all of it, so maybe I screwed up somewhere: maybe I accidentally created these as very broken links somewhere. I pored through my code, I ran all kinds of automated tests, but I could not find a smoking gun anywhere.

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:

You need to upgrade your browser

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.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Eliminate 404 errors for title_files


Inexpensive and informative Apple related e-books:

El Capitan: A Take Control Crash Course

Take Control of Automating Your Mac

Take Control of High Sierra

Take Control of iCloud

iOS 10: A Take Control Crash Course

More Articles by © Anthony Lawrence

Related Articles

Mon Dec 10 15:46:57 2007: 3310   BigDumbDinosaur

You need to upgrade your browser

I would have worded it "You need to replace your browser with one that adheres to published standards." <Grin>

Mon Dec 10 15:53:45 2007: 3311   TonyLawrence

They might just assume that anything Microsoft does *is* the standard :-)

Mon Dec 10 16:11:51 2007: 3312   TonyLawrence

By the way, a post at (link)
says that my redirect won't work and instead suggests this

# Fix up broken MSIE 6 "Save page as" .css path requests
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4\.0\ \(compatible;\ MSIE\ 6\.0;\ Windows
RewriteRule _files/([^/]+/)*([^.]+\.css)$ /$2 [L]

Mon Dec 10 16:25:46 2007: 3313   TonyLawrence

I also noticed this.
I have:

@import "/reset-fonts-grids.css";
@import "/nslate.css";
@import url( (link)

And now I see in my logs that IE has never screwed up with "branding.css", so maybe that is another way to fix it..

Sat Oct 18 21:20:33 2008: 4655   TonyLawrence

Also see (link) for more on 404 pages and their causes.


Printer Friendly Version

Related Articles

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

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)

Linux posts

Troubleshooting posts

This post tagged:


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)