Re: Help, please... Is there such an .htaccess URL option ?

From: Matti Juhani Kurkela (Matti.Kurkela@welho.com)
Date: 12/15/02


From: Matti Juhani Kurkela <Matti.Kurkela@welho.com>
Date: 15 Dec 2002 11:46:31 +0200

Mark246@email.com (Mark) writes:

> On Unix, Apache v 1.3.26, I've set up a password-protected directory
> using .htaccess & .htpasswd.
>
> When someone goes there and that "Please Enter your UserName &
> Password" screen appears, I DO NOT want it to display "Site:
> www.ThisIsTheDomain.com". Instead, I want it to say "Site:
> www.ThatDomain.com". Is there a way to change that?

I think that "Site: www.ThisIsTheDomain.com" represents the server's
idea of its official DNS name. Changing that just for the password
dialog would be something like forgery, and that's not nice: so the
Apache does not allow you to do that easily.

Instead, you should focus on the reason why the server thinks its name
is "www.ThisIsTheDomain.com" instead of the other one.

Apache is a very complex beast in this regard: one Apache server can
handle multiple DNS names and multiple IP addresses; and it can serve
different content depending on by what name or address the client uses.
(That's defined mainly by VirtualHost directives in the config file:
do you have any? If you do, check that the VirtualHost that applies to
your situation has a "ServerName www.ThatDomain.com" directive.)

Alternatively, Apache can serve the same content on all the IP
addresses and hostnames the server can be reached. I think this is the
default setting in most new Apache installations. If you do not set
ServerName in the configuration file in this case, Apache
asks the operating system for the official hostname (the OS can
look it up from the DNS or do something else entirely).

In this case, you should ensure that you have "ServerName www.ThatDomain.com"
in the server's main configuration file (httpd.conf).

If you don't have access to the httpd.conf file, you'll have to ask
your system administrator for help. ServerName and VirtualHost
directives can't be used in .htaccess files.

-- 
Matti.Kurkela@welho.com


Relevant Pages

  • Re: Please HELP!
    ... > overwritten -- Unclean shutdown of previous Apache run? ... > AddType application/x-compress .Z ... > AddType application/x-gzip .gz .tgz ... > ServerName "www.domain1.com" ...
    (freebsd-questions)
  • RE: apache --SOLVED
    ... You Rock Mark, ... Subject: apache --SOLVED ... Cary Pembleton wrote: ... for ServerName". ...
    (Debian-User)
  • Re: Why wont this script run??
    ... I reinstalled apache, and it works. ... > DirectoryIndex index.html index.htm.var index.htm ... DocumentRoot /home/www/html ... ServerName mo.moso.dk ...
    (Fedora)
  • Re: freebsd-newbies help....
    ... > DNS and to get apache to use the proper name ... A couple of options that might be useful for apache, here is a snippet from my ... # ServerName gives the name and port that the server uses to identify itself. ... See also the UseCanonicalName directive. ...
    (freebsd-newbies)
  • Re: php.ini errors?
    ... The Apache logs show nothing special, ... Move it back, fix anything you have done that caused phpinfo() to not display anything, and check in your phpinfo output which php.ini file you're using. ... Configuration File Path C:\Windows ...
    (comp.lang.php)