Conditional .htaccess 404 DirectoryIndex
Is it possible to change the DirectoryIndex in .htaccess in the event of a 404? I have a scenario where if there is a 404 I want to change the DirectoryIndex to index.htm inste开发者_JAVA技巧ad of index.php. By default though I have to declare DirectoryIndex in .htaccess so I am looking for something like an if else statement.
if 404
then DirectoryIndex=index.htm
else
then DirectoryIndex=index.php
is this possible? Thanks.
set Custom Error page in your .htaccess
ErrorDocument 404 index.htm
精彩评论