Force SSL on certain pages


/ Published in: Apache
Save to your folder(s)

Based on query string id force ssl.

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.