是否可以在发生404事件时更改.htaccess中的DirectoryIndex?我有一个场景,如果有一个404,我希望将DirectoryIndex更改为index.htm而不是index.php。但是,默认情况下,我必须在.htaccess中声明DirectoryIndex,所以我要寻找类似于if else语句的语句。
if 404
then DirectoryIndex=index.htm
else
then DirectoryIndex=index.php这个是可能的吗?谢谢。
发布于 2011-02-19 03:43:27
在.htaccess中设置自定义错误页
ErrorDocument 404 index.htmhttps://stackoverflow.com/questions/5045730
复制相似问题