This is a discussion on how to force/rewrite https connections for a certain directory within the Apache Web Server forums, part of the Web Server and Related Forums category; I have a directory in a virtual host in which I want to force SSL connections - the absolute path of ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have a directory in a virtual host in which I want to force SSL
connections - the absolute path of that directory is: /var/www/path1/path2/myapp/admin The virtual host of concern here is set up in the apache conf file like: <VirtualHost *> ServerName applications.domainname.com ServerAlias www.applications.domainname.com DocumentRoot /var/www/path1/path2 </VirtualHost> The virtual host is set up like: <VirtualHost _default_:443> DocumentRoot "/var/www/path1/path2" ... The admininstrative section is of the web site of concern is: applications.domainname.com/myapp/admin I want all pages in that directory to be forced to use SSL. I have tried several means to make this happen including directives in a directory of the conf file and an .htaccess file. Examples include: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/myapp/admin(.*) https://%{SERVER_NAME}/secure$1 [R,L] and this in an .htaccess RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L] Any ideas are MUCH appreciated! |