Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Redirect Problem

Quote Reply
Redirect Problem
My LinksSQL has both links to other sites and downloads. Any of my download links that start with ftp:// end up being written in the redirect as http://ftp://...

If found this bit of code in the jump.cgi file that I think is responsible, but I'm not really sure how to alter it:

Code:
# Now let's send the user to the url..
($goto =~ m,^http://,) or ($goto = "http://$goto");
$goto ? print $in->redirect ($goto) : return &error ("Record not found: $id");
}
}

I know that one part of it is a RegEx match expression but that's about it.

What I need for the program to do is not preface the URL's with anything at all.

Ideas?

Douglas
Quote Reply
Re: Redirect Problem In reply to
delete

Code:
($goto =~ m,^http://,) or ($goto = "http://$goto");

jerry
Quote Reply
Re: Redirect Problem In reply to
Thanks!
Quote Reply
Re: Redirect Problem In reply to
To play it safe, you should really do something like:

Code:
($goto =~ m,^(http|ftp)://,) or ($goto = "http://$goto");

To make sure the URL has _some_ protocol attached, with the default being http://

(Granted, you could do it: ^(ht|f)tp:// but that's less readable, and it won't show up if you do a search or find in the code for the http or ftp to make changes.)


------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/