using mod_rewrite on broken images?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Tubby
Forum Commoner
Posts: 28
Joined: Thu Oct 17, 2002 5:55 pm

using mod_rewrite on broken images?

Post by Tubby »

Hello,
I host a lot of images that people use on forums and am moving servers, but instead of moving all the images too I thought I'd clear out and delete them all, but instead of just deleting them so they all show as red x's on forums I would like it to show an image telling people how to get the broken image re-instated.

So basically, I want to use mod_rewrite in .htaccess so if an image is linked to and it dosent exist I want it to show a default image.

I've tried this so far but it dosen't work:

Code: Select all

Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{REQUEST_URI} !-U 
RewriteRule \.(gif|jpg|jpeg)$ їurl]http://domain.tld/rolleyes.gifї/url] їL]
(with my domain)
Am I going about it all wrong?

Suggestions / ideas please.

Thanks. :)
Post Reply