mardi 2 juin 2015

Using [OR] to erase www from http and https while forcing https

I am a newbe and I try tried the following command:

RewriteEngine On
RewriteCond %{HTTPS_HOST} ^www\.codie\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.codie\.com$
RewriteRule ^/?$ "https\:\/\/codie\.com\/" [R=301,L]
RewriteEngine On
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{THE_REQUEST} /index\.html
RewriteRule ^index\.html https://codie.com/ [R=301,L]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Well the stripping of www seems to work, but the https enforcment does not. For some reason I always end up at http://codieDOTcom, even when I type https://codieDOTcom.

Many thanks!




Aucun commentaire:

Enregistrer un commentaire