2
votes

Have a magento multi-site setup, 3 domains.

Want to arrange htaccess 301 redirects for http to https for all requests on only 1 of the 3 domains.

The code in Michael Berkowski's answer here works and preserves the rest of the URL (ie directs http://example.com/abc to https://example.com/abc), but it does this for every domain in the multisite setup.

How can I amend Michael's code so that I can specify domain1.com redirects, but domain2.com and domain3.com do not redirect?

Michaels code is here...

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
1

1 Answers

0
votes

Would changing the insecure base URL in the Magento configuration for that specific store scope be a considerable option for you? Only in the scope of the domain you wish to be https for all app (Magento) request.