Forum Moderators: phranque

Message Too Old, No Replies

https to http Rewrite Rule Not Working

Please help...

         

crobb305

1:55 am on Mar 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The following rewrite rule works for one of my sites but does not work for another.

RewriteEngine on

# Switch back to HTTP if HTTPS request for anything except /file/ subdirectory resources
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI}!^/file/
RewriteRule (.*) http://www.example.org/$1 [R=301,L]

For both sites, the htaccess files are identical with only the domains changed.

The site that works correctly properly forces https for the SSL pages and http for non-ssl pages.

The other site that is this is not working forces non-ssl pages to http as it should, but the SSL pages are NOT being forced to https if http is used.

The only thing I can think of is the SSL port of 443, but support tells me it is correct.

Do .org extensions need to be handled differently? The working site uses .com.

Any ideas?

jdMorgan

2:12 pm on Mar 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I see only one-half of the usually-required rules here. You also might want to try both ways of detecting HTTPS/HTTP connections, as described in this recent thread [webmasterworld.com].

Jim