SMF Support > SMF 2.1.x Support

CORS problem with Like button

(1/1)

smartmouse:
Hello, I'm using latest version of SMF 2.1 and I'm experiencing a problem with Like button.
When I try to press on "Like" nothing happens.

If I go to browser console I see this:


--- Quote ---Access to XMLHttpRequest at 'https://mywebsite.com/likes/?ltype=msg;sa=like;like=57746;c08e3192=efdd88eb49fc0ca02564fad54257ba4c;js=1&_=1584876372676' from origin 'https://www.mywebsite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
jquery.min.js:4

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://mywebsite.com/likes/?ltype=msg;sa=like;like=57746;c08e3192=efdd88eb49fc0ca02564fad54257ba4c;js=1&_=1584876372676 with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
--- End quote ---

How can I fix this?

vbgamer45:
Do you have an SEO mod installed?

The issue is you have two different domains www.mywebsite.com mywebsite.com you have to set the primary url to one or the other for your SMF urls.

or you can enable CORS on your server
https://enable-cors.org/server.html

smartmouse:

--- Quote from: vbgamer45 on March 22, 2020, 09:51:45 AM ---Do you have an SEO mod installed?

The issue is you have two different domains www.mywebsite.com mywebsite.com you have to set the primary url to one or the other for your SMF urls.

or you can enable CORS on your server
https://enable-cors.org/server.html

--- End quote ---

Yes, I have Pretty URLs mod installed... and thanks to your message I solved!
The URL in the mod mismatch the URL of my forum.

Thank you for your help ;)

smartmouse:

--- Quote from: vbgamer45 on March 22, 2020, 09:51:45 AM ---Do you have an SEO mod installed?

The issue is you have two different domains www.mywebsite.com mywebsite.com you have to set the primary url to one or the other for your SMF urls.

or you can enable CORS on your server
https://enable-cors.org/server.html

--- End quote ---

Yes, I have Pretty URLs mod installed... and thanks to your message I solved!
The URL in the mod mismatched the URL of my forum.

Now it works. Thank you for your help ;)

vbgamer45:
Glad to help

Navigation

[0] Message Index

Go to full version