的.htaccess迫使对SSL错误页面 [英] .htaccess forcing error pages on SSL
问题描述
我有下面这段code。在我的.htaccess文件强制重定向到自定义错误页:
I have the following piece of code in my .htaccess file to force redirecting to custom error pages:
ErrorDocument 404 /ErrorPages/404.php
ErrorDocument 403 /ErrorPages/403.php
ErrorDocument 400 /ErrorPages/generalError.php
ErrorDocument 401 /ErrorPages/generalError.php
ErrorDocument 500 /ErrorPages/generalError.php
一切工作正常的80端口,但是当涉及到SSL,标准错误页面显示。
Everything works fine on port 80, but when it comes to SSL, the standard error pages are shown.
要更具体:
HTTP:www.mydomain.com/NoExistingPage.php重定向到自定义错误页 HTTPS:www.mydomain.com/NoExistingPage.php的不重定向到自定义错误页
http:www.mydomain.com/NoExistingPage.php redirects to the custom error page https:www.mydomain.com/NoExistingPage.php DOES NOT redirect to the custom error page
我失去了一些东西呢?
在此先感谢
推荐答案
试着把重复.htaccess文件在/担保夹看看工程。虚拟主机的HTTPS守护程序可能使用/固定为doc_root的,这意味着,即使从常规的doc_root。htaccess的是下面的安全文件夹,它会被忽略。
Try putting a duplicate .htaccess file in the /secured folder and see if that works. The vhost for the https daemon is probably using /secured as doc_root which means even if the .htaccess from the regular doc_root is below the secured folder it will be ignored.
这篇关于的.htaccess迫使对SSL错误页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!