Forum Moderators: phranque

Message Too Old, No Replies

Copy a file to multiple folders

Need to get rid of those 404 errors!

         

madmatt69

9:54 pm on Apr 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey all,

I just looked at my error logs for my server (which hosts multiple sites) and wow does it have a lot of 404's mostly for things like favicon.ico.

I'm wondering if there's a command where I could copy a default favicon.ico into all those accounts, but be smart enough to not overwrite a favicon.ico if it already exists in the account?

jdMorgan

4:26 am on Apr 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That depends on precisely how the sites are set up because if they're in different DocumentRoots, then it'll take some doing to "cross over" into a different path to get the default icon. Then you'll have the same problem with robots.txt, /w3c/p3p.xml, labels.rdf, sitemap.xml, and a bunch of other 'common' files as well.

My first thought is to alias favicon.ico to a PERL script which can do the file exists check and then serve a default file if needed. I'd use a script because it can combine both the file-exists checking and the DocumentRoot crossing, and you can keep its permissions locked down at the main server level.

Jim

[edited by: jdMorgan at 4:27 am (utc) on April 4, 2008]