Apache Force SSL on vhost
Submitted by rac on 31 December, 2007 - 11:44.
https://trac.usvn.info/wiki/Documentation/HTTPSAccess
Edit your htaccess (or server conf file) to look like this one :
-
<Files *.ini>
-
Order Allow,Deny
-
Deny from all
-
</Files>
-
-
RewriteEngine on
-
RewriteBase /
-
-
RewriteCond %{SERVER_PORT} !443
-
RewriteRule ^(.*)?$ https://%{SERVER_NAME}$1 [L,R]
For thoses of you who don't know about RewriteCond?, the first one check the server port used to connect. If it's not 443 (default HTTPS port), it redirects all request to the same https vhost and URI.
Reference
Trackback URL for this post:
http://www.2030.tk/trackback/13
»
- Download PDF
- Printer-friendly version
- 1577 reads

Post new comment