Skip to content
Thinkcyber NYC
Digital
  • Contact Thinkcyber

Category: htaccess

Force SSL on your PHP site with .htaccess

Posted on July 9, 2016May 11, 2017 | by @thinkcyber

Force SSL on your PHP site

#Force SSL on entire site
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://(YOURDOMAIN)/$1 [R,L]

#Force SSL on a specific directory
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^DIRNAME/(.*)$ https://YOURDOMAIN/DIRNAME/$1 [R,L]
Posted in htaccess, Programming

Categories

  • apache2
  • FTP
  • Google
  • htaccess
  • jQuery
  • letsencrypt
  • Linux
  • Mac
  • Magento
  • MySQL
  • Os
  • PHP
  • Programming
  • Thinkcyber
  • Ubuntu
  • Wordpress
  • yii2
May 2022
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
« Sep    

Search

© 2022 Thinkcyber NYC. All rights reserved. | Theme developed by Thinkcyber