If fixing broken links is something you tend to avoid, here’s a simple solution which you might like as a quick fix until you can fix your broken links properly.
Please copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++
This code will redirect ALL 404 page errors to the example.com url which you can change to anything you like.
Hello Brad Dalton, Thanks i its nice thing and helpful for SEO .
But can i use it for phpmelody Video script page which is built by phpsmaarty template?
It redirects any URL which returns 404 so i don’t think it matters where the template comes from.
i tried it in the PhpMelody function.php file but It did not work for me. Just to let you know!
It works perfectly in any theme.
I know this because i tested it.
The code goes in your child themes functions file and will not work in other files.
Whats PhpMelody?
But it affects SEO? or confuse our visitor. Better (for me) is redirect to a page for error 404 with a search box and related articles.
(sorry for my bad english)
I think its better to not have 404 errors and maybe direct to a page with a list of posts, categories and search box that works.
Wow, that is pretty slick. I think I will use that.
Easier than using your .htaccess file i think Dave.