Trying to work out how to get Wordpress / .htaccess to show a 404 error page for invalid requests.
With a default WP .htaccess
file a request like
/?exam=testing.html
will redirect to the home page but it retains the invalid request as the URL.
The issue is that Google is treating this as a 'successful' load of a page that is a hacked 'exam papers site' page and listing the site as hacked.
Trying any invalid page request gives the same result like:
Options seem to be :
get .htaccess
to drop the request when redirecting to the Home Page so that the URL is only the /
- however this is still incorrectly suggesting a successful page from the request
prefer to see a 404, 403 or even 401 to clearly show that it was an invalid request and present an appropriate error page, so that Google tests will get an appropriate result, and humans creating errors will also be told.
However, trying to search results for the above provide a plethora of pages explaining how to avoid 404 errors, and not how to have them.
Any help appreciated.