The quick and easy way to redirect any 404 page to your main homepage in Joomla.
if (($this->error->getCode()) == '404') { header('Location: /index.php'); exit; }
If you are using SEO URL’s, you can simply remove index.php leaving only the / in place.
This is best practice for a website that does not have much content (static) or will never receive much content in the future.
By accepting you will be accessing a service provided by a third-party external to https://becomethesolution.com/
Comments
It worked. Thanks.
I don’t know much about 404 error pages because I had started my blogging career recently.
But somewhere I read that If any blogger or writer deleted the existing web page then the URL of that web page becomes 404 URL and that page becomes 404 page.
It is also said that Google don’t like 404 page so I checked my site whether I had any 404 page or not then I found few of the 404 error pages on my site also.
But Now after reading this post, I can easily handle these pages.
Thanks for sharing such a helpful post with us.
AS long as you redirect them to a working page on your site you should be just fine Your CMS backend should have built in plugins to also help mange where people are landing on your 404's