0

我可以通过 .htaccess 重定向什么时候

  • 用户发现内部服务器错误
  • 未找到的页面

那可能吗?如果是这样,有人可以帮我改写规则吗?

编辑

ErrorDocument 500 /oohps.php
ErrorDocument 404 /where.php

并将它们添加到 domain.com/oops.php 和 domain.com/where.php 但仍未加载

4

2 回答 2

1

为什么不直接使用自定义错误响应ErrorDocument

ErrorDocument 500 /errors/internal-server-error.html
ErrorDocument 404 /errors/not-found.html
于 2012-01-19T11:26:40.503 回答
1

通过修改 /etc/apache2/conf.d/localized-error-pages 文件中的“ErrorDocument”,我可以重定向到 404 错误(找不到页面)的索引页面,这很有用。

谢谢.....

于 2013-01-19T05:33:41.530 回答