Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


force_https_by_directory

Differences

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

Link to this comparison view

force_https_by_directory [2008/08/02 23:27]
juckins created
force_https_by_directory [2008/08/02 23:29] (current)
juckins
Line 1: Line 1:
 +cd to directory you want to protect.
 +
 vi .htaccess vi .htaccess
  
 +<​code>​
 RewriteEngine On RewriteEngine On
 RewriteCond %{HTTPS} off RewriteCond %{HTTPS} off
 RewriteRule (.*) https://​%{HTTP_HOST}%{REQUEST_URI} RewriteRule (.*) https://​%{HTTP_HOST}%{REQUEST_URI}
 +</​code>​
  
 -or- -or-
  
 +<​code>​
 SSLRequireSSL SSLRequireSSL
 +</​code>​
 +
 +then:
  
-restart ​httpd+<​code>​¬†
 +service ​httpd restart¬†
 +</​code>​
  
  
force_https_by_directory.txt · Last modified: 2008/08/02 23:29 by juckins