Anybody knows how to redirect all the invalid links to the home page? I want to redirect all the invalid that doesn't exit to home page. For example: If someone type in an invalid link like http://www.agxy.com/invest or http://www.agxy.com/invest.php I want to make them redirect to home page http://www.agxy.com instead of 404 page.
It'll only show the home page, but it won't redirect the link to the home page. It still shows the invalid link.
Ask your webhosting service, they may allow a custom 404 error page, this will not redirect, but show the home page at the invalid url.
Or, I found that, you may test it and tell us the result. Change: ErrorDocument 404 /index.php To errorDocument /index.php I'm not sure about. I found it here, just try it !
Go into your .htaccess file and change it to ErrorDocument 404 /error.php Code (markup): Then in error.php have <?php header('Location: /index.php'); PHP: