Posted by:
hambuler
(---.cpe.net.cable.rogers.com)
The Wise One Wrote:
-------------------------------------------------------
>
> is there a way to do this in the apache conf file
> versus an htaccess file? i prefer not to use
> htaccess if at all possible.
>
> basically, and i dont know if this is possible or
> not, but i want to leave some parts of the local
> server on http, and only apply https to a single
> directory and its children.
My suggestion is to use this rewrite below and put them inside the localhost directive <directory "C:/wamp/www/"> ..... </directory> in httpd.conf file.
RewriteEngine On
# Enable HTTPS only if the directory matches 'your_HTTPS_directory' and its subdirectories
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/your_HTTPS_directory_name.*
RewriteRule .* - [F,L]
# redirect HTTP to HTTPS only if the request URL matches 'your_HTTPS_directory' and its
# subdirectories
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/your_HTTPS_directory.*
RewriteRule (.*) "[
]%{HTTP_HOST}%{REQUEST_URI} [L]"
NOTE: remove the quotation marks " at the last line.
Edited 2 time(s). Last edit at 04/08/2008 08:06PM by hambuler.