404 htaccess redirect is not working
I am running tomcat on apache 开发者_运维问答we server. I am putting .htacces in project folder inside tomcat/webapps directory. I am using following line inside .htaccess for 404 redirection
ErrorDocument 404 /404Redirect.html
But it is not working. Please let me know the location where i should place .htaccess or if i am doing mistake in redirection code
i had same problem. I solved it by adding RewriteEngine on
before ErrorDocument 404 /404Redirect.html
please ensure that 404Redirect.html
is in the same directory as the .htaccess
file.
First check if you can use .htaccess
file! Second your file(404Redirect.html
) related to your document root NOT .htacsess
file!
精彩评论