I'm trying to help a friend whose client knee-jerked her whole site into SSL after a hacking attempt. It's wreaking havoc w/ her SEO, causing duplicate pages to be indexed, bleeding PageRank where old links no longer point to the correct URL, etc, etc.
Anyway, I modeled the .htaccess after another post on here that seemed to almost fit the bill, but I wanted to run it by the experts here to make sure that the file looked correct.
Basically, ALL pages on the site need to be redirected back to HTTP from HTTPS except a handful of html pages, some .php pages, and a .cgi script. Can you tell me if there's an easy rule to set all php pages to be HTTPS, and then set a few additional HTML pages behind HTTPS and a .cgi script? I'd really appreciate it. Here's what I've got so far:
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit GET POST>
order deny,allow
deny from all
</Limit>
AuthName thedomain.com
AuthUserFile /home/thesitename/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/thesitename/public_html/_vti_pvt/service.grp
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} page1.html
RewriteCond %{REQUEST_URI} page2.html
RewriteCond %{REQUEST_URI} page3.html
RewriteCond %{REQUEST_URI} page4.html
RewriteCond %{SCRIPT_FILENAME} \/page\.php [NC]
RewriteCond %{SCRIPT_FILENAME} \/page\.php [NC]
RewriteCond %{SCRIPT_FILENAME} \/page\.php [NC]
RewriteCond %{SCRIPT_FILENAME} \/page\.php [NC]
RewriteCond %{SCRIPT_FILENAME} \/page\.php [NC]
RewriteCond %{SCRIPT_FILENAME} \/page\.php [NC]
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !(auth|register|secure)
RewriteCond %{REQUEST_URI} !originalpage.php
RewriteCond %{REQUEST_URI} !cgi-script.cgi
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301]