You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Ralf S. Engelschall" <rs...@engelschall.com> on 1998/02/27 11:07:55 UTC
Re: unqualified names
In article <19...@tiber.cisco.com> you wrote:
>> From: Dean Gaudet <dg...@arctic.org>
>>[...]
>> I cringe when my coworkers refer to our internal webserver by its
>> unqualified name. They've no idea why I'm cringing. I'm probably the
>> only one there that uses the FQDN. These aren't dumb users either,
>> they're just not aware what's going on behind the scenes. If we ever use
>> authentication or cookies on this server... boy will they be annoyed at
>> how broken they are with unqualified names.
>>[...]
> You can use mod_rewrite to detect when your server is called by an
> unqualified host name. There are two obvious choices if you do that:
> either redirect it to the equivalent fully-qualified name or redirect
> it to a page scolding them for using an unqualified name. ;-)
> I've used stuff like this for a couple years...
> ------------------------------------------------------------------------------
> RewriteCond %{HTTP_HOST} !^fully.qualified.domain.name
> RewriteCond %{HTTP_HOST} !^$
> RewriteCond %{SERVER_PORT} !^80$
> RewriteRule ^/(.*) http://fully.qualified.domain.name:%{SERVER_PORT}/$1 [L,R]
>
> RewriteCond %{HTTP_HOST} !^fully.qualified.domain.name
> RewriteCond %{HTTP_HOST} !^$
> RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R]
> ------------------------------------------------------------------------------
Nice. Can I insert this solution into my URL Rewriting Guide under
http://www.engelschall.com/pw/apache/rewriteguide/ ?
Ralf S. Engelschall
rse@engelschall.com
www.engelschall.com