logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Force users to use SSL for a specific dir
Author
pjdelsh007



Joined: 07 Mar 2008
Posts: 2

PostPosted: Fri 07 Mar '08 23:23    Post subject: Force users to use SSL for a specific dir Reply with quote

I've searched but can't find an answer. How can I restrict users to SSL for a specific directory?

Browsing the root of www.domain.com without SSL is fine

I want to permit SSL only to https://www.domain.com/directory1

and block non-SSL to http://www.domain.com/directory1
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3094
Location: Hilversum, NL, EU

PostPosted: Tue 11 Mar '08 23:46    Post subject: Reply with quote

An possible solution is to use mod rewrite for that domain when the condtion is http://www.domain.com/directory1

Should also possible to make a rule in mod_security.

Steffen
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 12 Mar '08 10:58    Post subject: Reply with quote

Code:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com\/inside$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/inside$1 [R=301,L]


This forces SSL only in the older inside
Back to top


Reply to topic   Topic: Force users to use SSL for a specific dir View previous topic :: View next topic
Post new topic   Forum Index -> Apache