
Originally Posted by
ThatGuy
So in wordpress what is the best way to setup about 1,100 410 status?

If you can identify the bad requests because there are offensive words in the URLs or the querystrings, you can put code in your top level .htaccess that will report the URLs as Gone even before the request reaches WordPress.
Here is some template code for doing that, but you must NOT just drop this code into your .htaccess. You will need to understand exactly what it does and customize it for your purposes. This is just an example. If any of the bad words appears in the base URL or in the query string, the associated page will get a 410 response.
If you can't identify the requests by there being offensive words in the URI or query string, this code won't help at all.
Example of bad word in URI:
hxxp://yoursite.com/buy-cheap-badword-online.html
Example of bad word in query string:
hxxp://yoursite.com/index.php?topic=badword
The list of words for the URI and query string don't have to be the same.
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} (badword1|badword2|badword3) [NC,OR]
RewriteCond %{QUERY_STRING} (badword1|badword2|badword3) [NC]
RewriteRule .* - [G,L]
I just keep finding wordpress plugins that do a 301 redirect to the site root.
I haven't used WordPress. I think some applications redirect 404's to the site root by default. Don't know if that's true of WP. If it is, there may not be much you can do about it unless you dig into the code or try to modify WP's default .htaccess, which would carry the risk that you might mess things up.
Bookmarks