How to redirect an error 404 to home page with .htaccess?

Try:

FallbackResource /index.html

or whatever the homepage is


try:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /index.html [L]

Or save a reroute step and just put the following into your .htaccess file:

ErrorDocument 404 /index.php


You can do this like

this will be .htaccess file:

ErrorDocument 404 /404.php

All the page not found pages will display 404.php file.

In 404.php file you can write:

<?php
    header('location:index.php');
?>

So all page not found pages will go to 404.php page and it will redirect them to index.php