--- Keith Szlamp <[EMAIL PROTECTED]> wrote:
> my $domain = $ENV{'SERVER_NAME'};
> $domain =~ s/^http:\/\/www.//;
> $domain =~ s/^http:\/\///;
> 
> Regardless of what they enter, you should end up with just 'domain.tld' or
> 'sub.domain.tld' if the name being forward using sub domains - like many
> ISPs do for free hosting space.

To be honest, while I don't know a simple answer for this, the reality is that this 
answer doesn't
work very well.  People can easily type stuff like:

  http://blogs.server.somehost.co.uk/
  http://foo.co.uk/
  https://www.host.com/

There are plenty of other things I could toss out that cause issues here.

Cheers,
Ovid

=====
Hire me!                   http://users.easystreet.com/ovid/personal/resume.html
Silence is Evil            http://users.easystreet.com/ovid/philosophy/indexdecency.htm
Ovid                       http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl  http://users.easystreet.com/ovid/cgi_course/

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to