Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Get the exact URL host name

Reply
Thread Tools

Get the exact URL host name

 
 
=?Utf-8?B?U3RlcGhhbmU=?=
Guest
Posts: n/a
 
      09-19-2006
Hi,

Is there a way to know what exactly a hostname is?

Per example, we can have the domain « domain.qc.ca » and it could come in
one of those forms:

www.domain.qc.ca
sub.domain.qc.ca
domain.qc.ca

And so on...

I'd like to have only the name « domain.qc.ca ». Same thing for any domain
with any extension like .com, .net, .fr, .on.ca, or whatever the extension
could be

Any idea?

Thanks

Stephane
 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      09-19-2006
Request.Url.Host should do it for you.

See : http://asp.net.do/test/Apppath.aspx



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Stephane" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Is there a way to know what exactly a hostname is?
>
> Per example, we can have the domain domain.qc.ca and it could come in
> one of those forms:
>
> www.domain.qc.ca
> sub.domain.qc.ca
> domain.qc.ca
>
> And so on...
>
> I'd like to have only the name domain.qc.ca . Same thing for any domain
> with any extension like .com, .net, .fr, .on.ca, or whatever the extension
> could be
>
> Any idea?
>
> Thanks
>
> Stephane



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client Machine Name or Host name ? Anil G Java 4 01-31-2008 04:10 PM
Can I check the exact URL within an XMLHTTPRequest? Gabriella Javascript 2 10-12-2007 01:40 PM
How To: Allow For Accessing site By Only the Domain Name, Without the Host Name? Joey ASP .Net 0 09-15-2005 03:04 AM
Re: How to get the exact page name from URL Scott Allen ASP .Net 0 04-24-2004 03:21 PM
request.getHeader("Host") returns wrong host name Orpheus66 Java 0 07-30-2003 02:59 PM



Advertisments