0

Might be a quick question for someone but it's not an area I have a huge amount of knowledge in.

I want to rewrite a URL using .htaccess if the query string is empty:

http://mydomain.com/js/file.js?foo=

So it rewrites to something like:

http://mydomain.com/js/error.js

Thanks in advance.

1 Answer 1

1
RewriteCond %{QUERY_STRING} ^foo=$
RewriteRule ^js/file.js$ /js/error.js [R=301,L]
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.