我正在网站上工作(scratchyone.com)。我需要将.htaccess重定向到外部页面
http://scratchywon.github.io/scratchyone.com/errors/500.html
出现500错误。我用php强迫500。
http://scratchyone.com/500/
这是我目前的代码:
ErrorDocument 500 http://scratchywon.github.io/scratchyone.com/errors/500.html
编辑:ErrorDocument 404 http://scratchywon.github.io/scratchyone.com/errors/500.html
有效
现在我使用php发送500错误,页面不显示。它只显示浏览器的默认值" 500:无法显示"
答案 0 :(得分:1)
.htaccess中的内部错误没有中继自定义ErrorDocument(!)并且通过PHP模拟500错误是不可能的 - 当你的脚本运行它太晚了 - 错误文档重定向由apache mod_core(!)处理而PHP只发送状态。 所以我认为你可以忘记PHP 500仿真。
尝试在main .htaccess旁边创建一个目录,然后在make中创建.htaccess
关于500的部分提供了如何通过错误代理模拟此错误的信息。