Forum Moderators: phranque
First, I have a SEO request whereby all requests to HTTPS need to be '301' redirected to HTTP so that we will not have duplicate results in search engines.
Second, I have 5 forms under the same site that collect customer-sensitive information and need to be forced to be HTTPS (and excluded from the first rule).
So far, I've been unsuccessful getting the second rule by itself to work as it always creates a redirect loop no matter what I try. My last attempt:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule "^/form1.html$" "https://%{HTTP_HOST}%{REQUEST_URI}" [R=301,L]
So, simply condensed, I need a rule that will force all traffic to be HTTP except for 5 specific URIs that need to be forced to be HTTPS.
Any help would be appreciated! Thank you!
-Jay
RewriteCond %{SERVER_PORT} !=443
RewriteCond $1 ^secure-form1\.html$ [OR]
RewriteCond $1 ^secure-form2\.shtm$ [OR]
RewriteCond $1 ^secure-form3\.php$ [OR]
RewriteCond $1 ^secure-form4\.shtml$ [OR]
RewriteCond $1 ^secure-form5\.cfm$
RewriteRule ^/(.+)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{SERVER_PORT} =443
RewriteCond $1 !^secure-form1\.html$
RewriteCond $1 !^secure-form2\.shtm$
RewriteCond $1 !^secure-form3\.php$
RewriteCond $1 !^secure-form4\.shtml$
RewriteCond $1 !^secure-form5\.cfm$
RewriteRule ^/(.+)$ http://%{HTTP_HOST}/$1 [R=301,L]
Jim
-Jay