How do I redirect 404's to index.html and rewrite the URL to the home page URL?
You can use these 2 lines at the top of your .htaccess:
DirectoryIndex index.html
ErrorDocument 404 http://domain.com/
DirectoryIndex
will make http://domain.com/
load http://domain.com/index.html
by default and use of http://
in ErrorDocument
will make it redirect to new URL.
Try below code :
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . / [L,R=301]
ErrorDocument 404 /index.php
It's any 404 url
to your home page.