Missing Header CORS „Access-Control-Allow-Origin”

I moved my website on CakePHP from root to subfolder /sklep/ (i added Rewritebase /sklep and website is working). After that i can’t add product to cart in shopping plugin. In console i got error: domain.com/shop/shopping/addToCart/358/380/1”. (missing header CORS „Access-Control-Allow-Origin”). Can someone help me with this?

if the site was working previously it means that there is some url that points data to your old url, check /config/app.php if there is such setting (like fullBaseUrl or simmilar) other wise you will have to check all templates and check url option in Form.

Thanks for the reply. I changed path in routes.php. With no result.
I’m working on CakePHP 2.4.1 and i don’t have file /config/app.php on my server. Templates seems to be ok.

You say you moved your website from root to /sklep/ but the error is for domain.com/shop?
Sounds like you’re trying to access the wrong subdirectory.
Shouldn’t the request go to /sklep/shop/...?

Thanks! I finally found it. It was wrong url in webroot/js/scripts.js.
Solved :slight_smile:

1 Like