in reply to Re: 404 image errors
in thread 404 image errors

That won't work as you forgot to initialise $url to $ENV{'REDIRECT_URL'}.

I'd also suggest that

for (@image_extensions) { if ($url =~ /\.${_}$/) {
was changed to
for my $ext (@image_extensions) { if ($url =~ /\.$ext$) {
which makes things a bit more clear

gav^

Replies are listed 'Best First'.
Re: Re: Re: 404 image errors
by cjf (Parson) on Jun 11, 2002 at 12:58 UTC

    This isn't necessary, but what if .jpg becomes a domain suffix?

    use URI; my $addr = URI->new($url); my $path = $addr->path; for my $ext (@image_extensions) { if ($path =~ /\.$ext$/) { ....

    Probably not worth it to add this in, but I thought I'd point it out anyways :).