Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Remove http:// from urls

Quote Reply
Remove http:// from urls
I need a global that will display the URL with the http:// in front of it. So the url will be displayed as www.gossamer-threads.com . Is there an easy way to do this? Do I even need a global or is there something I can just edit on <%URL%>. I have no clueUnsure

Thanks,

Craven
Quote Reply
Re: [craven32] Remove http:// from urls In reply to
I'm trying to add this to some javascript which will pull maps but I need it in the plain www.mysite.com format. I still can't get rid of the http:// though. Any suggestions?
Quote Reply
Re: [craven32] Remove http:// from urls In reply to
Try this one;

<%global($URL)%>


Code:
sub {
my $url = $_[0];
$url =~ s/^http:\/\///i;
return $url;
}

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Remove http:// from urls In reply to
Hi Andy,

Works perfect! Thanks

Craven
Quote Reply
Re: [Andy] Remove http:// from urls In reply to
Hello Andy,

With your opinion, it is possible to obtain a link like :
my-site

and not like :
http://www.my-site.com

I would like to register the link in fields to direct on WHOIS.
<input type="text" name="Domain" value="<%global($URL)%>" >

An idea ?

Thank you for your assistance.

Mick