Article:
  Step by Step: Configuring SSL Under Apache
Subject:   Only a few pages need SSL under root folder
Date:   2008-08-29 21:54:55
From:   thien_king_mui
Hi guys,


For instance, I only got a few pages that need SSL connection and the rest no need. All the page are under root folder. How to configure that?


Thanks & Regards,
Mark Thien
sdalk.com

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Only a few pages need SSL under root folder
    2010-05-22 06:37:18  betol [View]

    In the examples below, it is considered that your site is accessible at http://localhost/myapp/

    #[1] all /myapp/user, /myapp/subscription and /myapp/login pages should be served in https

    RewriteRule /myapp/user https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    RewriteRule /myapp/subscription https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    RewriteRule /myapp/login https://%{HTTP_HOST}%{REQUEST_URI} [R,L]


    The following rules need to be put it in your <VitualHost *:443> section

    #[2] For all other pages, if in https mode, serve the page in http mode.
    RewriteCond %{SERVER_PORT} ^443$
    RewriteCond %{REQUEST_URI} !^/myapp(/login|/user|/subscription)
    RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI} [L]

    Hope this helps.