AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: evolancer on September 18, 2014, 08:44:50 PM

Title: AJAX ERROR - when WWW. isn't in URL
Post by: evolancer on September 18, 2014, 08:44:50 PM
Under the settings: I have my full-site URL set too: "www .mysite. com" but when I'm typing in "mysite .com" into a browser its not redirecting it to  www .mysite .com with the "www" added in. This gives me an UNKNOWN AJAX ERROR when adding products to my cart. Is their a fix for this or is AbanteCart aware of this issue.

I'm also on the HTML5 Template if that helps.
Title: Re: AJAX ERROR - when WWW. isn't in URL
Post by: Basara on September 19, 2014, 01:38:51 AM
Hello.

If you want to redirect all non-www requests to your site to the www version, all you need to do is add the following code to your .htaccess file
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

This will redirect any requests from http://my-domain.com to http://www.my-domain.com.
Title: Re: AJAX ERROR - when WWW. isn't in URL
Post by: evolancer on September 19, 2014, 09:13:54 AM
Thank you I will give this a shot!