Posted By

tribal on 03/17/11


Tagged

modrewrite


Versions (?)

Force SSL on certain pages


 / Published in: Apache
 

Based on query string id force ssl.

If you want to do multiple pages, change id=login with id=(login|page|page2|pagen)

  1. RewriteEngine On
  2.  
  3. RewriteCond %{QUERY_STRING} id=login
  4. RewriteCond %{SERVER_PORT} ^80$
  5. RewriteRule ^(index.php|)$ https://www.yourdomain.co.uk/index.php [R=301,QSA,L]
  6.  
  7. RewriteCond %{IS_SUBREQ} false
  8. RewriteCond %{SERVER_PORT} ^443$
  9. RewriteCond %{QUERY_STRING} !(id=login)
  10. RewriteRule ^(index.php|)$ http://www.yourdomain.co.uk/index.php [R=301,QSA]

Report this snippet  

You need to login to post a comment.