Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


force_https_ssl_by_directory_with_.htaccess

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

force_https_ssl_by_directory_with_.htaccess [2008/08/04 14:50] (current)
juckins created
Line 1: Line 1:
 +cd to directory you want to protect.
 +
 +vi .htaccess
 +
 +<​code>​
 +RewriteEngine On
 +RewriteCond %{HTTPS} off
 +RewriteRule (.*) https://​%{HTTP_HOST}%{REQUEST_URI}
 +</​code>​
 +
 +-or-
 +
 +<​code>​
 +SSLRequireSSL
 +</​code>​
 +
 +then:
 +
 +<​code>​
 +service httpd restart
 +</​code>​
 +
  
force_https_ssl_by_directory_with_.htaccess.txt ยท Last modified: 2008/08/04 14:50 by juckins