tags:

views:

106

answers:

2

For example, one instance of apache is managing www.site.com/folder1/a.html www.site.com/folder2/b.html www.site.com/folder3/c.html

I need to make sure that access to www.site.com/folder3/c.html is https only.

All these folders are in the same document root.

Is this possible? If not, what you recommend as the minimum changes necessary in order to get what I want?

A: 

I believe you can do something in the Apache configuration like:

RedirectMatch /folder3/(.*) https://www.site.com/folder3/$1

Not sure if that's proper though.

Hope that helps...

Andrew Flanagan
This results in an infinite redirection loop.
Nathan Spears
A: 

You can try this solution:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/folder3/c.html$ https://www.site.com/folder3/c.html$1 [R,L]

With this solution you can also define which kind of redirection to apply. And, the most important, the rule will only run when in HTTP scheme.

Pierre-Yves Gillier
This looked so technical that I thought it must be right! However I can't get any response from this code. Is there some preliminary step I need to take before using this code?
Nathan Spears