This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: http --> https for certain folder only?
Author
Message |
mlbrillo
Newbie


Joined: 27 January 2012
Posts: 2
Posted: 27 January 2012 at 10:32am

I need a rule that directs the person to https if they hit a certain directory on my site.  For example:

http://www.mysite.com/securedirectory/[*any page*]

need to go to:

https://www.mysite.com/securedirectory/[*any page*]

I have seen the following example:

RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? https://%1%2 [R,L]

But this redirects my entire site, not just the specific directory I want redirected.  Can someone help me determine where to insert the directory name that needs to be redirected?  TIA
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 30 January 2012 at 4:27am

Hello,

try using the following:

Code:
RewriteCond %{HTTP:Host} (www\.domain\.com) [NC]
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} (/FolderName/.*)
RewriteRule .? https://%1%2 [R,L]


Regards
Andrew
Back to Top
 
mlbrillo
Newbie


Joined: 27 January 2012
Posts: 2
Posted: 30 January 2012 at 8:25am

Works like a charm!  Thanks so much, I would have never figured that one out.
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version