Question:
Is it possible to clear the %{QUERY_STRING}
without breaking any functionality of what I\'ve accomplished in my .htaccess fil
Try:
RewriteCond %{THE_REQUEST} \?[^\ ]+
RewriteRule (.*) /$1? [R=301,L] #remove query string
You need to match against the actual request because you're building a query string with these rules:
# To internally rewrite directories as query string
RewriteRule ^([^/=]+)=([^/]*)(/(.+))?\/?$ /$4?$1=$2 [N,QSA]
RewriteRule ^([^/=]+)/([^/=]+)(/(.+))?\/?$ /$4?$1=$2 [N,QSA]
RewriteRule ^([^/=]+)(/(.+))?\/?$ /$3?$1 [N,QSA]
When these rules loop around, the %{QUERY_STRING}
variable will have stuff in it and your rules will clobber them. If you match against the actual request, your rewrites won't get affected.