how to force/rewrite https connections for a certain directory

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-10-2006
Notgiven
 
Posts: n/a
Default how to force/rewrite https connections for a certain directory

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!


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0