Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
add comment

1 Answer

Check with RewriteCond if QUERY_STRING is empty and if HTTPS is "off" before redirecting the client with a RewriteRule.

share|improve this answer
    
RewriteCond %{HTTPS} !=on RewriteCond %{THE_REQUEST} ^([^?]+)$ RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L] –  jalal allam Oct 26 '10 at 13:53
    
but not work probable –  jalal allam Oct 26 '10 at 13:54
    
THE_REQUEST is the wrong variable, use the one I've mentioned. Also SERVER_NAME should be HTTP_HOST. –  joschi Oct 27 '10 at 6:16
add comment

Your Answer

 
discard

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.