Hello. I've got this virualhost that is accesseble both through http (port 80)and https (port 443). Yet in that documentroot I have one directory that I only whant to be accessable through https (port 443) and not port 80.. I have OptFollowSymlinks up and running and working perfectly What I want is this: /www/mysite/* <-- Accessable from from both p80 and p443 /www/mysite/security/* <---- Only accessable p443 Can I block with /www/mysite/security/.htaccess port 80? And how do I do that? Does anyone know?=) Mvh -- Jon
This is what I use for an entire domain.. It should work on the subdirectory by adding ReWriteBase /sub... Tell me if it doesn't work. Options +FollowSymlinks RewriteEngine on RewriteBase /secure RewriteCond %{SERVER_PORT} !443$ RewriteRule (.*) https://www.blahblah.com/$1 [R=301,L] Code (markup):
Is it possible to only do this from the .htaccess file?? The site is realy live and a lot of people on it.. Dont wanna reload the apache..?
Yes this is meant to be done within the directory. It should work right away, no restart needed. I like Terry Pratchet, too.
In those instances a "graceful" restart of your httpd will not disconnect people. And it should not need a restart provided the Override FileInfo is set (otherwise the .htaccess file will be ignored)