I am trying to setup my htaccess file such that all 404 pages are permanently redirected to the home/index
page using 301. After I configure the htaccess file I try to test that it is working correctly by typing in a bogus URL such as site.com/asdf
to see if the 404 will redirect. It does not, it just displays the page not found message from WordPress and fails to redirect to the homepage.
The code I am using (below) seemed to be working over on Stack Overflow (link, 2nd reply). I have even tried creating a PHP script to use with htaccess to redirect 404's, but still the same result, no redirection.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . / [L,R=301]
# END WordPress
RewriteEngine
directive) - the two sets of rules are conflicting. However, because they are conflicting it might break your WordPress rewrites?