Site Fuse! programming, design, hosting, promotion and advertising tips for webmasters
Design    Programming    Hosting    Classifieds

Any .htaccess masters?


Important: The following is a text only archive!
For full features; Go to Any .htaccess masters?

posted by Lycan I need some sort of .htaccess rule which will do the following:
I have a bunch of images in a folder that are hotlinked on other servers. I want to delete all these images and redirect all these 404`s so that instead of the hotlinkers getting a nice red X they`ll get a new image I`ll upload to my server.

I know there is a way to do it but I don`t know how. Anyone?

posted by 2Guns Not sure how much / what sort of traffic you have on that domain, but that could be a waste of valuable non-image 404 traffic. The following code will redirect image "404s" to a default image, normal "document" 404s will be treated "normally".

RewriteEngine on
RewriteCond %{REQUEST_URI} !-U
RewriteRule \.(gif|jpg|jpeg)$ /your_path_to/new.gif [L]
# the following is for normal 404s
ErrorDocument 404 http://www.your404.com