I recently implemented the following virtual host settings in my apache2.conf file:
# force HTTPS
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{REQUEST_URI} !^/path1.html
RewriteCond %{REQUEST_URI} !^/path2.html
#RewriteCond %{REQUEST_URI} ^/path3.html
#RewriteCond ${REQUEST_URI} !^/index.html
RewriteRule . https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
One of the services that I'm integrating with communicates with my service using HTTP POST. However, they noticed that since implementing this config and making a call to http://, when my server forces the call to be made over https, the request type is changed from POST to GET and the POST messages are dropped. I was wondering if there was a way to update this code to force the original POST/GET method to be kept intact.
Best Answer
The calling service is broken, but there's not much you can do about it unless you can fix the caller. From RFC 2616:
Your options are: