.htaccess SSL on certain pages
Basically I'm using drupal and can current redirect to an SSL page. But once on that page and continuing navigation all the pages contin开发者_C百科ue over HTTPS. There is a single page I need SSL on and I need to redirect back after you leave that page. Currently I have this:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^conference https://url/conference/ [R=301,L]
RewriteCond %{SERVER_PORT} =443
RewriteRule !^conference http://url%{REQUEST_URI} [R=301,L]
Thanks
The Secure Pages module can do exactly what you describe, in a highly configurable manner, so adding additional pages in the future can be done w/o editing .htaccess.
Add this rule to return to HTTP:
RewriteCond %{SERVER_PORT} =443
RewriteRule !^join http://www.example.com%{REQUEST_URI} [R=301,L]
After the form data has been POSTed, redirect to an absolute HTTP URL.
Also, note that the form page itself does not need to use SSL; it is enough for the data to be POSTed to a HTTPS URL. This means that you do not need to use mod_rewrite at all for this.
精彩评论