Try this. A few additions and a minor tweak:
There may be other rules elsewhere on your site that interfere with it.Code:ErrorDocument 404 /index.php?main_page=page_not_found RewriteEngine on # Fails with 404 error, any URL request that includes # record_company.php/password_forgotten.php # at any folder depth or root. RewriteRule ^([^/]+/)*record_company\.php/password_forgotten\.php$ /page-does-not-exist [L] # Fails with 404 error, any URL request that includes # images/wp- with 'wp-' being anything that ends with '.php' # this allows for images named such as 'wp-header.jpg' to work RewriteRule ^([^/]+/)*images/wp-([^.]+)\.php$ /page-does-not-exist [L]



