PDA

View Full Version : Apache Error messages for multiple domains?



dansroka
08-02-2005, 08:37 AM
I have Apache Error Messages installed in order to have custom error messages. However, I have multiple domains on my account, and it appears that each domain uses the same error message. This isn't a huge deal, but I'd like to have a custom error message for each domain. Any ideas if this is possible?

visible soul
08-06-2005, 11:11 PM
I have Apache Error Messages installed in order to have custom error messages. However, I have multiple domains on my account, and it appears that each domain uses the same error message. This isn't a huge deal, but I'd like to have a custom error message for each domain. Any ideas if this is possible?
I'm not sure about using the Apache Error Messages application but you can configure each non-primary domain to use a different set of error pages by editing httpd.conf or I think you can do the same thing in a .htaccess file.

Here is the way I have been doing this in httpd.conf...



<VirtualHost *>
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /var/www/html/mydomain
ErrorDocument 401 /site/error/401.htm
ErrorDocument 403 /site/error/403.htm
ErrorDocument 404 /site/error/404.htm
ErrorDocument 500 /site/error/500.htm
</VirtualHost>


I think you can put this in a htaccess file in the root directory of your non-primary domain...

ErrorDocument 401 /site/error/401.htm
ErrorDocument 403 /site/error/403.htm
ErrorDocument 404 /site/error/404.htm
ErrorDocument 500 /site/error/500.htm

dansroka
08-08-2005, 07:24 AM
Thank you - that's exactly what I wanted to know.

Dan