Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i need to create a rewrite rule to redirect my page from to

But in the case that the client opened the page with any GET parameter, it should remain the same without any redirecting. For example:

  • should redirect to
  • should not redirect.
share|improve this question
And the webserver is ? {apache|nginx|lighttpd|IIS|...} – Julien Vehent Oct 10 '10 at 13:51
up vote 0 down vote accepted


RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{THE_REQUEST} ^([^?]+)$
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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