Forum Moderators: phranque
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} url=(cur_page|price-min|beds-min|baths-min|price-max)
RewriteRule ^$ - [G] RewriteCond %{QUERY_STRING} url=(cur_page|price-min|beds-min|baths-min|price-max)
RewriteRule ^$ - [G]
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} \bcur_page\b [NC]
RewriteRule ^ - [G] I thought it would be an easy way to 410 everything with just one lineYes, you can do that. The question was just where the heck the "url" part came from.
RewriteCond %{QUERY_STRING} (cur_page|price-min|beds-min|baths-min|price-max)
without anchors should work just fine. RewriteCond %{QUERY_STRING} \b(cur_page|min|max)\b
taking advantage of the fact that - (hyphen) is a non-word character.
RewriteRule ^ - [G]
RewriteCond %{QUERY_STRING} \b(cur_page|price-min|beds-min|baths-min|price-max)=
RewriteRule ^index\.php$ - [G]
RewriteCond %{QUERY_STRING} \b(cur_page|min|max)\b but I am not 100% certain that there might not be some links at the backend of the cms with the 'min' or 'max' parameters. I decided to go with the more restrictive rule from the last post and all seems to work great. RewriteRule constant1/constant2 - [G] RewriteRule constant1/constant2 - [G]
It seems to work ok, but I am wondering if this is safe / sufficient or if I need to add any extra characters?
RewriteRule ^constant1/constant2/[0-9]+\.html$ - [G] [edited by: phranque at 10:11 pm (utc) on Jan 9, 2019]
RewriteRule ^constant1/constant2/ - [G]If nothing fitting this pattern is still in use, you don't need a closing anchor or a longer pattern, because the server already has all the information it needs.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L] RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]