httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Min-Hua Luo <>
Subject Re: [users@httpd] virtual host problem
Date Thu, 19 Jul 2007 00:20:58 GMT
Hi Joshua,
  Sorry bother you again. I am having problem to implement custom error page for HTTP 403
(Forbidden) error. This is my configuration:
  <VirtualHost *:12311>
    ServerName default.only
    ErrorDocument 403 /error_pages/forbidden.html
      <Location />
        Order allow,deny
        Deny from all
      <Location /error_pages>
        Order allow,deny
        Allow from all
  For some reason, the custom error page cannot not be displayed and I got this error:
  Forbidden  You don't have permission to access / on this server. 
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument
to handle the request. 
  Could you please tell me what I did wrong? Thanks again for your help.

Joshua Slive <> wrote:
  On 7/18/07, Min-Hua Luo wrote:
> Hi,
> I have two virtual hosts defined in httpd.conf
> Listen 12311
> NameVirtualHost *:12311
> ServerName
> DocumentRoot /u07/twpdev
> ServerAdmin
> ErrorLog /u07/twpdev_error_log
> Listen 12312
> NameVirtualHost *:12312
> ServerName
> DocumentRoot /u07/oasis
> ServerAdmin
> ErrorLog /u07/oasis_error_log
> I can access the first site using However,
> I found I can also access the same page using
> because both
> "" and "" resolve to the same IP.
> This is NOT what I want. So my question is:
> How can I configure httpd.conf so port 12311 only respond to HTTP requests
> that address to "" instead of any hostnames that point to
> the same IP address? Thank you very much.

You can't, because the hostname isn't known until after the server has
already accepted the request. But you can easily redirect such
requests to a different hostname:
or you can return a 403 forbidden error:


The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail:
" from the digest:
For additional commands, e-mail:

Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
View raw message