Re: mod_vhost_alias 404 / ErrorDocument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mod_vhost_alias takes the requested URL and matches a directory on the server. The point of using mod_vhost_alias is so you don't have to create vritual host record for each site on your server.

my domain is setup as a wildcard domain, so *.mydomain.com will not produce a DNS error.

Graham


Dragon wrote:
Graham Clarke did speak thusly:
Hi - I'd like to setup a meaningful error page for a virtual host that uses mod_vhost_alias. If a visitor enters a url that doesn't exist on the server they're served a custom error page.
Here's a simple example:

The vhost has:
VirtualDocumentRoot /var/www/html/customer/%1

Requests for http://samplesite.mydomain.com will serve /var/www/html/customer/samplesite/index.html

However, if the user makes a mistake and enters "amplesite.mydomain.com" apache throws an error.

My question is how to catch these cases and show a friendly error page rather than an ugly apache error?

Thanks,
Graham
---------------- End original message. ---------------------

I think you might be confused here.

The example you are giving would likely not even get to Apache in the first place as it is likely to be a DNS error you are getting as the "amplesite.mydomain.com" subdomain probably does not have a DNS entry.

To verify this, see if you get a valid IP address when you query DNS using nslookup or dig for the "amplesite.mydomain.com" host.


Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


--
Graham Clarke
53 Technology

+ www.53tech.com
+ grahamc@xxxxxxxxxx
+ 603-643-9955


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux