Pergunta

Problem with custom error pages. My server root is "C:\www" and error pages are in "C:\www\errors". So I put a .htaccess file in "C:\www" with following:

ErrorDocument 404 /errors/404.html
ErrorDocument 403 /errors/403.html
ErrorDocument 500 /errors/500.html

This works for anything in "mysite.net". But I also have subdirectories like "first.mysite.net", "second.mysite.net" and so on, and .htaccess from root doest work there. It's searching for "errors" folder in these subfolders and return the default 404 page.

I've tried this:

ErrorDocument 500 C:/www/errors/500.html
ErrorDocument 500 C:\www\errors\500.html

Doesn't work.

ErrorDocument 500 http://mysite.net/errors/500.html

This works, but it makes a redirect and I don't want this. I want the browser to keep adress line the same.

Can anyone make this clear for me? Thanks.

Foi útil?

Solução

If they are subdomains with seperate virtualhost definitions you need to check virtualhost definitions and AllowOverride settings for those subdomains. See http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride and change AllowOverride setting as needed.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top