retrieve HTTP_HOST with case-sensitivity (as entered on the client)?

P

Paul Smith

This doesn't seem like it should be *that* difficult, but after
quite some time trying to figure it out, I'm still banging my
head against the wall.

My objective is to examine the exact case-sensitive domain used
by the client to request a page, such as http://www.mysite.com vs.
http://www.MySite.com. As I spin through all the ServerVariables
and various & sundry HTTP headers (e.g. ALL_HTTP, ALL_RAW,
etc.), all I seem to pick up is the domain name as it's understood by
the server itself - all lowercase. In principle, I just want to redirect
requests made to, e.g. "themaples.com" to "TheMaples.com" for
readability purposes.

TIA for any suggestions. I have access to ASP & ASPX on the
server-side if it makes any difference. PHP & Perl/cgi are also
present, but I don't code in them at all & would need much more
hand holding to implement such a workaround. Plain vanilla ASP
is preferred by far if possible.

Cheers,
Paul
 
D

Don Verhagen

In Paul Smith <[email protected]> typed:
: This doesn't seem like it should be *that* difficult, but after
: quite some time trying to figure it out, I'm still banging my
: head against the wall.
:
: My objective is to examine the exact case-sensitive domain used
: by the client to request a page, such as http://www.mysite.com vs.
: http://www.MySite.com.

Domain names *are not* case sensitive. URL's maybe case sensitive depending
on Windows verus *nix.

Mysite.com and mysite.com cannot point to 2 different servers. The name is
already resolved by a DNS (ISP's usually) before.


Don Verhagen


: As I spin through all the ServerVariables
: and various & sundry HTTP headers (e.g. ALL_HTTP, ALL_RAW,
: etc.), all I seem to pick up is the domain name as it's understood by
: the server itself - all lowercase. In principle, I just want to
: redirect requests made to, e.g. "themaples.com" to "TheMaples.com" for
: readability purposes.
 
T

TomB

You could just do "it" regardless.
I thought that javascript may help, but not for the domain part of the url.

Also, reinforcing the domain name with a big ol' Welcome to
TheMooglyDudes.com type thing may help.
 
P

Paul Smith

Domain names *are not* case sensitive. URL's maybe case sensitive depending
on Windows verus *nix.

Mysite.com and mysite.com cannot point to 2 different servers. The name is
already resolved by a DNS (ISP's usually) before.

Thanks for the reply, Don. I'm with you on the fact that domain names
themselves are case-insensitive; I'm actually not trying to point to two
different servers. My only goal is to change the way the domain is
*displayed* in a visitor's address bar. If they type in or click a hyperlink
to, e.g. "themooglydudes," I just want to use a redirect or 301 status or
somethink akin to that in order to reload the page as "TheMooglyDudes."

In other words, I can't control how others type the domain in links that
get posted on the web, but I'm hoping I can control how the domain
gets displayed to visitors once they enter. In order to do that, I need
to be able to inspect the fully qualified URL exactly as it appears in a
client browser, and this is the step I'm hung up on at the moment.

Thanks again,
Paul
 
D

Don Verhagen

In TomB <[email protected]> typed:


You cannot control the casing of the DOMAIN part of the URL. This is
determined by the entry in the DNS server.

The user enters: http://www.MYURL.com
It's looked up on their (ISP's normally) DNS server (case-insenstively)
DNS server returns IP and DOMAIN name (formatted as it is on the DNS Server)
Usually returns in all lower case http://www.myurl.com

For more info I believe you can read RFC 1464.

Don



: You could just do "it" regardless.
: I thought that javascript may help, but not for the domain part of
: the url.
:
: Also, reinforcing the domain name with a big ol' Welcome to
: TheMooglyDudes.com type thing may help.
:
:
: ::: Domain names *are not* case sensitive. URL's maybe case sensitive
::: depending on Windows verus *nix.
:::
::: Mysite.com and mysite.com cannot point to 2 different servers. The
::: name is already resolved by a DNS (ISP's usually) before.
::
:: Thanks for the reply, Don. I'm with you on the fact that domain
:: names themselves are case-insensitive; I'm actually not trying to
:: point to two different servers. My only goal is to change the way
:: the domain is *displayed* in a visitor's address bar. If they type
:: in or click a hyperlink to, e.g. "themooglydudes," I just want to
:: use a redirect or 301 status or somethink akin to that in order to
:: reload the page as "TheMooglyDudes."
::
:: In other words, I can't control how others type the domain in links
:: that get posted on the web, but I'm hoping I can control how the
:: domain
:: gets displayed to visitors once they enter. In order to do that, I
:: need to be able to inspect the fully qualified URL exactly as it
:: appears in a client browser, and this is the step I'm hung up on at
:: the moment.
::
:: Thanks again,
:: Paul
 
D

Don Verhagen

In Bite My Bubbles <[email protected]> typed:
: http://www.xmission.com/~turq/Casio/
:
: http://www.xmission.com/~turq/CASIO/
:
: UNIX IS MADDENING
:

I said the DOMAIN part(ie www.xmission.com), not the entire URL, as your
example above demostrates.

http://www.xMISSION.com/~turq/Casio
and
http://www.Xmission.com/~turq/Casio

Both will get you to the same place regardless of unix/linux/windows

Don

: :: In :: TomB <[email protected]> typed:
::
::
:: You cannot control the casing of the DOMAIN part of the URL. This is
:: determined by the entry in the DNS server.
::
:: The user enters: http://www.MYURL.com
:: It's looked up on their (ISP's normally) DNS server
:: (case-insenstively) DNS server returns IP and DOMAIN name (formatted
:: as it is on the DNS Server) Usually returns in all lower case
:: http://www.myurl.com
::
:: For more info I believe you can read RFC 1464.
::
:: Don
::
::
::
::: You could just do "it" regardless.
::: I thought that javascript may help, but not for the domain part of
::: the url.
:::
::: Also, reinforcing the domain name with a big ol' Welcome to
::: TheMooglyDudes.com type thing may help.
:::
:::
::: ::::: Domain names *are not* case sensitive. URL's maybe case sensitive
::::: depending on Windows verus *nix.
:::::
::::: Mysite.com and mysite.com cannot point to 2 different servers. The
::::: name is already resolved by a DNS (ISP's usually) before.
::::
:::: Thanks for the reply, Don. I'm with you on the fact that domain
:::: names themselves are case-insensitive; I'm actually not trying to
:::: point to two different servers. My only goal is to change the way
:::: the domain is *displayed* in a visitor's address bar. If they type
:::: in or click a hyperlink to, e.g. "themooglydudes," I just want to
:::: use a redirect or 301 status or somethink akin to that in order to
:::: reload the page as "TheMooglyDudes."
::::
:::: In other words, I can't control how others type the domain in links
:::: that get posted on the web, but I'm hoping I can control how the
:::: domain
:::: gets displayed to visitors once they enter. In order to do that, I
:::: need to be able to inspect the fully qualified URL exactly as it
:::: appears in a client browser, and this is the step I'm hung up on at
:::: the moment.
::::
:::: Thanks again,
:::: Paul
 
B

Bite My Bubbles

I know you said the domain is not case sensitive. I did not dispute that
did I?
I am saying that URLs are case sensitive and that it is maddening.
Just a little side note.
 
D

Don Verhagen

In Bite My Bubbles <[email protected]> typed:
: I know you said the domain is not case sensitive. I did not dispute
: that did I?
: I am saying that URLs are case sensitive and that it is maddening.
: Just a little side note.

My bad, actually you didn't "dispute" anything. So I assumed you were giving
an example on unix in which the domain case sensitivity mattered. That's
what I get for assuming and what you get for being ambiguous. =)

I work on both Unix and Windows, so I know the maddening. I always use lower
case, regardless of the platform, to keep my URLs straight.

No harm no foul.

Don

:
:
: :: In :: Bite My Bubbles <[email protected]> typed:
::: http://www.xmission.com/~turq/Casio/
:::
::: http://www.xmission.com/~turq/CASIO/
:::
::: UNIX IS MADDENING
:::
::
:: I said the DOMAIN part(ie www.xmission.com), not the entire URL, as
:: your example above demostrates.
::
:: http://www.xMISSION.com/~turq/Casio
:: and
:: http://www.Xmission.com/~turq/Casio
::
:: Both will get you to the same place regardless of unix/linux/windows
::
:: Don
::
::: :::: In :::: TomB <[email protected]> typed:
::::
::::
:::: You cannot control the casing of the DOMAIN part of the URL. This
:::: is determined by the entry in the DNS server.
::::
:::: The user enters: http://www.MYURL.com
:::: It's looked up on their (ISP's normally) DNS server
:::: (case-insenstively) DNS server returns IP and DOMAIN name
:::: (formatted as it is on the DNS Server) Usually returns in all
:::: lower case http://www.myurl.com
::::
:::: For more info I believe you can read RFC 1464.
::::
:::: Don
::::
::::
::::
::::: You could just do "it" regardless.
::::: I thought that javascript may help, but not for the domain part of
::::: the url.
:::::
::::: Also, reinforcing the domain name with a big ol' Welcome to
::::: TheMooglyDudes.com type thing may help.
:::::
:::::
::::: ::::::: Domain names *are not* case sensitive. URL's maybe case
::::::: sensitive depending on Windows verus *nix.
:::::::
::::::: Mysite.com and mysite.com cannot point to 2 different servers.
::::::: The name is already resolved by a DNS (ISP's usually) before.
::::::
:::::: Thanks for the reply, Don. I'm with you on the fact that domain
:::::: names themselves are case-insensitive; I'm actually not trying to
:::::: point to two different servers. My only goal is to change the
:::::: way the domain is *displayed* in a visitor's address bar. If
:::::: they type in or click a hyperlink to, e.g. "themooglydudes," I
:::::: just want to use a redirect or 301 status or somethink akin to
:::::: that in order to reload the page as "TheMooglyDudes."
::::::
:::::: In other words, I can't control how others type the domain in
:::::: links that get posted on the web, but I'm hoping I can control
:::::: how the domain
:::::: gets displayed to visitors once they enter. In order to do
:::::: that, I need to be able to inspect the fully qualified URL
:::::: exactly as it appears in a client browser, and this is the step
:::::: I'm hung up on at the moment.
::::::
:::::: Thanks again,
:::::: Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top