Post by Astromagical » Fri Mar 19, 2021 5:48 pm

Hi

I have looked through old forum posts and have got myself completely confused. :crazy: :crazy: ???

My site is https://savannahsunset.com on OC Version 3.0.3.6
When I use www. in front of my sitename the icons for Add to Car, Wishlist and compare are missing and I get an "error undefined" on the products on the home page. See image attached.

Looking through old forum posts it looks like I need to add something into the htaccess and possibly config files. Please can you help me by giving me exactly what I need to change and where to make the changes and in which files.

Thanks

Attachments

Capture.JPG

Capture.JPG (28.37 KiB) Viewed 1714 times


Newbie

Posts

Joined
Fri Oct 30, 2020 10:04 pm

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Astromagical » Fri Mar 26, 2021 5:46 pm

xxvirusxx wrote:
Fri Mar 19, 2021 7:36 pm
viewtopic.php?t=183503
Thanks for this but it is precisely the reason I got confused - it does not help me in any way as there is so much code and no real solution.
Please help.
I need in detail how to make the website work with both https://www.mydomain.com as well as the default of https://mydomain.com. It is not the http to https - I have both working on https. I need to know how to get the site to accept the www and provide all the functionality I get without it.

Newbie

Posts

Joined
Fri Oct 30, 2020 10:04 pm

Post by ADD Creative » Mon Mar 29, 2021 2:43 am

Lots of different ways to do that. One such example. After RewriteEngine On.

Code: Select all

RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Astromagical » Thu Apr 08, 2021 6:42 pm

Thank you for the help

Newbie

Posts

Joined
Fri Oct 30, 2020 10:04 pm

Post by EvolveWebHosting » Thu Jul 22, 2021 10:20 pm

The solution above looks a little bit incomplete.

Add this to .htaccess (the RewriteBase / should already be there so add the two lines below it)
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

Then make sure www is included in the HTTP and HTTPS URL section of both config.php files.

Opencart Hosting Plans, Domain Registration, Microsoft and Google Email and More
Visit our website for great deals and most importantly, fast and friendly support - www.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA
Who is online

Users browsing this forum: No registered users and 57 guests