1

I'm trying to remove any instance of ?s= from any url its placed into.

This is the current rewrite rule I'm using but it just throws a 500 error any idea why?

RewriteCond %{QUERY_STRING} ^s=$
RewriteRule ^(.*)$ $1 [L,R=302,QSD]

1 Answer 1

2

You might be on older Apache versions because flag QSD is only supported on newer Apache versions 2.4+. On older Apache versions this will cause 500 internal server error.

You can use this rule instead:

RewriteCond %{QUERY_STRING} ^s=$
RewriteRule ^ %{REQUEST_URI}? [L,R=302]

? in target URL will discard existing query string.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.