from ssl page to non ssl page

Fix it!!

from ssl page to non ssl page

Postby markthien » Mon Sep 08, 2008 11:29 pm

Hi guys,

When user navigate to a secure page like https://www.sdalk.com/login.jsp and after that they click on a link which will go to http://www.sdalk.com/index.jsp. However, the it's still https://www.sdalk.com/index.jsp a secure page. the index.jsp is not neccessary to be a secure page. how to rewrite this?

Thanks & Regards,
Mark Thien
markthien
 
Posts: 7
Joined: Mon Sep 08, 2008 11:28 pm
Location: Singapore

Postby richardk » Wed Sep 10, 2008 10:13 am

So only login.jsp should be secure? Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# If it's HTTPS and not login.jsp, switch to HTTP.
RewriteCond %{SERVER_PORT} ^443$
RewriteRule !^login\.jsp$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# If it's HTTP and login.php, switch to HTTPS.
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^login\.jsp$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron