Hello guys,
I put all my php file under root and there are like 20 of them for which only 3 php page need to be in https and the rest dont need. Hence I wrote my rewrite rules as follow:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^twitext.com [NC]
RewriteRule ^(.*)$ http://www.twitext.com$1 [L,R=301]
# pages that need SSL
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.signup.php)$ https://www.twitext.com$1 [R,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.login.php)$ https://www.twitext.com$1 [R,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.account-setting.php)$ https://www.twitext.com$1 [R,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.home.php)$ https://www.twitext.com$1 [R,L]
# pages that need no SSL
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.gateway.php)$ http://www.twitext.com$1 [R,L]
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.help.php)$ http://www.twitext.com$1 [R,L]
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.contact.php)$ http://www.twitext.com$1 [R,L]
is there anyway we can shorten this up? Appreciate any comment please.
Yours faithfully,
Mark Thien