in reply to 404 image errors
Amend as you see fit if you want to return same file type - but I think most browsers can interpret the mime without needing the correct extension.use CGI; my $q = new CGI; my @image_extensions = qw(gif png jpg jpeg); for (@image_extensions) { if ($url =~ /\.${_}$/) { print $q->redirect(-uri=>'http://image.url/here.gif'); exit(0); } }
You don't want to return html (the img tag) because that's text.
Please learn CGI - it will make your life easier in the long run - honest!
cLive ;-)
ps - remember, you will need to send the redirect before outputting a text/html header to the browser.
Update: pps - sorry, I should have stated - this was a snippet to go in your existing code (hmmm). I've expanded below...
--
seek(JOB,$$LA,0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: 404 image errors
by gav^ (Curate) on Jun 11, 2002 at 12:45 UTC | |
by cjf (Parson) on Jun 11, 2002 at 12:58 UTC | |
|
Re: Re: 404 image errors
by katgirl (Hermit) on Jun 11, 2002 at 12:37 UTC | |
by cLive ;-) (Prior) on Jun 11, 2002 at 12:48 UTC | |
by katgirl (Hermit) on Jun 11, 2002 at 12:59 UTC | |
by merlyn (Sage) on Jun 11, 2002 at 13:26 UTC | |
by katgirl (Hermit) on Jun 11, 2002 at 13:38 UTC | |
by merlyn (Sage) on Jun 11, 2002 at 13:43 UTC | |
by Abigail-II (Bishop) on Jun 11, 2002 at 13:45 UTC | |
|