I have a .htaccess file that looks like this:

RewriteEngine on
RewriteRule ^login$ /login.php? [L,R=301]

However when I do any get parameters such as /login?random=get&params=true they don't get passed through to the login.php file. How can I fix this?

1 Answer 1


RewriteRule ^login$ /login.php? [L,R=301]

You need to remove the ? on the end of the RewriteRule substitution. This is effectively creating an empty query string, removing anything that is passed in the request.

RewriteRule ^login$ /login.php [L,R=301]

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.