我在linux环境中运行apache2网络服务器,我想将用户重定向到自定义的错误页面,并在htdocs中创建符号链接,如下所示。静态文件-> /app/静态文件。在httpd.conf文件中,我已经创建了虚拟主机定义,并包含了错误页,如下所示:
NameVirtualHost m.mydomain.com:80
<VirtualHost m.mydomain.com:80>
DocumentRoot "/app/httpd-2.2.15/htdocs"
ServerName m.mydomain.com:80
<Directory "/static-files/html/error_pages">
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
ErrorLog /app/httpd-2.2.15/logs/error_my_log
ErrorDocument 400 /static-files/html/error_pages/error_400.html
ErrorDocument 401 /static-files/html/error_pages/error_401.html
ErrorDocument 403 /static-files/html/error_pages/error_403.html
ErrorDocument 404 /static-files/html/error_pages/error_404.html
ErrorDocument 408 /static-files/html/error_pages/error_408.html
ErrorDocument 500 /static-files/html/error_pages/error_500.html
ErrorDocument 501 /static-files/html/error_pages/error_501.html
ErrorDocument 502 /static-files/html/error_pages/error_502.html
ErrorDocument 503 /static-files/html/error_pages/error_503.html
ErrorDocument 504 /static-files/html/error_pages/error_504.html
</VirtualHost>当我的应用服务器关闭时,它不会将我重定向到503自定义错误页面。如果我将此ErrorDocument放在虚拟主机定义之外,它会将我重定向到自定义错误页面,从而得到服务器特定的错误页面only.But。我撞了我的头3 days.But找不到原因我尝试了所有browsers.Anybody可以帮助我吗?
发布于 2018-08-14 23:20:17
由于您将DocumentRoot定义为"/app/httpd-2.2.15/htdocs",因此错误页面应该位于此目录中。您确定错误页在此目录中吗?
发布于 2011-07-13 20:47:52
我不是100%确定,但当你有一个运行在Apache后面的应用服务器,当它宕机时,你会有一个404找不到。不是503的答案。503发生在服务器(应用程序服务器的Apache )上存在错误时,例如加载或未配置后可能发生的任何事情。
https://stackoverflow.com/questions/6678947
复制相似问题