Jun 6, 2019 - Learn how to set up URL forwarding or redirects with Cloudflare. If you use a basic redirect, such as forwarding the root domain to. Jul 10, 2012 - A custom 404 page lets you provide a user-friendly website to your visitors. Keep them on your site and do more to redirect them to their destination. To edit the 404 page, open up or create the site's.htaccess file. Keep in mind that the Apache looks for the 404 page located within the site's server root.
I have an old Wordpress website with a lot of pages. I changed to a single page website and I want to redirect all 404 errors with 301 redirect to Homepage.
I don't want to use plugins or change the 404 page. I want to do it in the .htaccess file.
This is the code I tried:
This works perfect with almost all cases, like:
But it didn't work in the cases below:
The problem is that this don't work with URLs that contains Wordpress terms:https://codex.wordpress.org/WordPress_Query_Vars
Does anybody know how to solve this problem?
MárcioMárcio