I have a V2.3.0.2 installation running two sites using the multistore feature.
The primary domain (www.domain1.com) redirects correctly, all versions
http://domain1.com
https://domain1.com
http:// www.domain1.com
https://www.domain1.com
all route to the store under https://www.domain1.com. This is configured in .htaccess.
However, the secondary store (www.domain2.com) can only be accessed when https://www.domain2.com is entered into the browser. All of the other variations route to https:///www.domain1.com
so,
http://domain2.com
https://domain2.com
http:// www.domain2.com
all end up at https://www.domain1.com
Domains and hosting are all managed in a cpanel environment.
Is this something I need to correct in .htaccess or in cpanel?
all pointers appreciated
Or inside your addon domains.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
the current .htaccess file contains,ADD Creative wrote: ↑Wed Dec 08, 2021 10:01 pmYes, it's probably a problem with your redirects in htaccess.
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.domain1.com%{REQUEST_URI} [R=301,L,NE]
RewriteBase /
No mention of domain2.com. I'll be honest, I'm not going to try and guess what is missing!
both domains are installed as Domains, and have the Opencart directory as their root directories.
both domains are also in Addon Domains, again both have the Opencart directory as their root directories.
Try something like.
Code: Select all
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^domain1\.com$
RewriteRule ^(.*)$ https://www.domain1.com/$1 [E=HTTPS,R=301,L]
RewriteCond %{HTTP_HOST} ^domain2\.com$
RewriteRule ^(.*)$ https://www.domain2.com/$1 [E=HTTPS,R=301,L]
Thank you so much, that's fixed it!ADD Creative wrote: ↑Thu Dec 09, 2021 2:38 amTry something like.
Code: Select all
RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTP_HOST} ^domain1\.com$ RewriteRule ^(.*)$ https://www.domain1.com/$1 [E=HTTPS,R=301,L] RewriteCond %{HTTP_HOST} ^domain2\.com$ RewriteRule ^(.*)$ https://www.domain2.com/$1 [E=HTTPS,R=301,L]
Who is online
Users browsing this forum: No registered users and 70 guests