301 redirect from "/index.html" to root if index.html not exist
- by Andrij Muzychka
Can I create 301 redirect from "index.html" to root directory if file "index.html" not exist?
For example: link "http://example.com/index.html" show "404 Error" page.
I need 301 redirect to root directory: "http://example.com/"
in .htaccess I add rule:
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://example.com/$1 [R=301,L]
but it doesn't work.
Can you help me solve this problem?