Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 General
 Off topic, News and Updates
 htaccess changes for www and https
Author « Topic »  

Vince
Administrator

Spain
42743 Posts

Posted - 04/06/2022 :  05:02:56  
Hi All
Your web browser can treat the www. and non-www. and http and https forms of your store URL as totally different URLs. This means if you add cart contents using one form of the URL and then navigate to another form you can lose the cart contents, and maybe then lose the customer. For PHP users the best way to stop this is using your site .htaccess file to force customers onto one of these URL forms. The www. form of the URL is preferable to the non-www. form (but it is your choice), and if you have an HTTPS certificate on your site it is usual nowadays to have your entire site on HTTPS, not just the checkout.

Try your site and add something to the cart and then in the browser address bar, try changing between the http / https / www. and non-www. forms of the URL and see if you lose the cart contents. If you do, you may want to add this.

This entry for the .htaccess file will force www. and https.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^yourstoreurl\.com [NC]
RewriteRule (.*) https://www.yourstoreurl.com/$1 [L,R=301]
</IfModule>


If you do add this, make sure your Store URL in the ECT Admin -> Main Settings page is set to the https and www form of the URL.

After making any changes the test and make sure the checkout process still works.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

OmerEstrada
Starting Member

Bangladesh
5 Posts

Pre-sales questions only
(More Details...)

Posted - 06/16/2022 :  18:52:08  
All of the new websites have https now rather than using www.

charmarsh
Ecommerce Template Expert

USA
940 Posts

Posted - 05/19/2023 :  12:35:43  
Vince, this seemed to fix both issues. Thank you!
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000