I would like the user to be redirected to the main page of the site when trying to access a non-existent page within the domain.
For example, I have only the following pages:
-
meudominio.com/home
-
meudominio.com/contato
If the user accesses any other page by mistake and / or typos, such as meudominio.com/troll
, redirect to meudominio.com/home
.
I have read that this is done in the files .htaccess
or 404.php
, but I do not know how to configure it.