javascript - Access-Control-Allow-Origin OPENCART NO SOLUTION -
i got problem website, know in opencart, have config.php can handle http request, here code below:
define('http_server', 'http://www.domain.com/'); define('https_server', 'https://www.domain.com/');
website work if enter website www. domain.com won't work without www. example: http://domain.com
and if remove www. config.php website work well.
i believe problem cause of access-control-allow-origin
i tried use following code in .htaccess
header add access-control-allow-origin "*" header add access-control-allow-headers "origin, x-requested-with, content-type" header add access-control-allow-methods "put, get, post, delete, options"
by adding above code, website work not full functionally. still problem exist in jquery-2.1.1.min.js
catalog/view/javascript/jquery/jquery-2.1.1.min.js
so, please guide me how make work both of them?
for example: domain.com , www.domain.com
after configer http://www.domain.com/, put these lines .htaccess file located on opencart root folder. if don’t have file, you’ll have create first.
rewriteengine on rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l]
these rules redirect non-www traffic domain www version avoid cross-domain conflict. additional difficulties may experience due explained conflict session lost after login , incomplete orders after paypal check our due incorrect call url settings. above configuration should resolve of mentioned issues.
Comments
Post a Comment