.htaccess - .htaccess不会重定向到错误页面

标签 .htaccess redirect error-handling

我希望页面重定向到自定义错误500页面。但是,当我指定要重定向到的页面时,将显示普通的旧500错误页面,而不是我的页面。

我正在用这条线做

ErrorDocument 500 /errors/error500.html

但是,如果我指定HTML而不是链接,则可以使用
ErrorDocument 500 '<div style="width:200px; margin:0 auto; text-align:center">Oooppss <br></div>'

我究竟做错了什么??

最佳答案

您的RewriteBase基础是什么?

您可以尝试完整的路径/usr/local/web/index.html吗?

〜K

关于.htaccess - .htaccess不会重定向到错误页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13250053/

相关文章:

vue.js - [Vue警告] : Error in render: "TypeError: Cannot read properties of undefined (reading ' length')"error when using datatables in vue

php - 如何处理PDO事务错误并告知客户端结果呢?

apache - WordPress 空白页问题没有 www &/

apache - htaccess 将主机名重定向到 FQDN

.htaccess - .htaccess 文件中超过 4,000 条重定向 301 行

linux - 非常奇怪的重定向行为

java - 将错误处理从 JSP 替换为 Servlet

mysql - index.php 未加载到 WordPress 的主文件夹中

c++ - 如何在 C++ 代码中捕获 python 标准输出

php - RewriteRule 不适用于生产服务器