I'm using Craft CMS 3 multisite installation with more than 20 website based on subdomains. There are websites:
website.com
one.website.com
two.website.com
with identical url paths but different content.
I need to redirect each website from http
to https
.
Root website htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
</IfModule>
But this adds index.php
to URL while redirects. So http://one.website.com/test
become into https://one.website.com/index.php?p=test