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 have setup my apache2 configuration to redirect http requests to https. This works fine however I want to change it so that it only does this if the request is not a POST request.

Here is my current configuration:

RewriteEngine On

RewriteCond %{HTTPS} !=on

RewriteRule ^/?(.*) https:// %{SERVER_NAME}/$1 [R,L]

How can I change this configration so that it only redirects when the request is not a POST?

share|improve this question
up vote 1 down vote accepted

Add a new RewriteCond line:

RewriteEngine On
RewriteCond %{HTTPS} !=on
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.