ddantes
asked on
Requesting assistance with htaccess coding
I'm migrating my website to a secure (https) server. There is code in htaccess which is unintentionally redirecting browsers to the non-secure (http) website. The purpose of this code was to redirect requests for mysite.com to www.mysite.com. If possible, I'd appreciate code which would redirect requests for http://mysite.com or http://www.mysite.com or https://mysite.com to https://www.mysite.com However, an exception must be made for a few pages which present a scrolling, panoramic view, because those pages don't perform correctly when there is a www. prefix...
Here is the code which is presently causing an unwanted redirect to the non-secure server...
# redirect entire site from non-www to www except Panoramic View pages
RewriteCond %{REQUEST_URI} !^/viewtriage.htm$
RewriteCond %{REQUEST_URI} !^/view.htm$
RewriteCond %{REQUEST_URI} !^/viewipad.htm$
RewriteCond %{REQUEST_URI} !^/viewother.htm$
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Here is the code which is presently causing an unwanted redirect to the non-secure server...
# redirect entire site from non-www to www except Panoramic View pages
RewriteCond %{REQUEST_URI} !^/viewtriage.htm$
RewriteCond %{REQUEST_URI} !^/view.htm$
RewriteCond %{REQUEST_URI} !^/viewipad.htm$
RewriteCond %{REQUEST_URI} !^/viewother.htm$
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER