Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin'
#1
Hello,

Having a problem with sidebar content.
If I create a link on the sidebar that loads an article inside my website, I have the following problem:

At the top I display two links: one with a phone and one with an email.

While using any other page inside my website, the icons look like this:
http://s7.postimg.org/hyg65dr0r/image.png

While using any links inside my sidebar pointing to a page inside my website, the icons look like this:
http://s27.postimg.org/aegu0aes3/image.png

Chrome is giving me the following error inside Dev Tools:

Font from origin 'https://mydomain.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.mydomain.com' is therefore not allowed access.
article-name:1


Any clue how to get past this small issue?

Later edit:

It seems that if I use https://www.mydomain.com on any page the icons will not load, with the above error.

It I use https://mydomain.com the icons load just fine on any page, including the sidebar links.

Will look more into it and get back.

Even later edit:
It seems my links inside the sidebar have to be in the format https://mydomain.com and NOT https://www.mydomain.com or the font will not load properly.

This fix is ok for now. Just have to find out why it behaves like this, because my site loads just fine with or without www (https version).


Thank you
Reply
#2
sounds like something your browser automatically does when you are using https.
www. is a subdomain , it is not the same site with that regard.

since gs loads urls absolutely, you must access the site with the siteurl in settings.
you probably should be redirecting all www. traffic to the normal domain anyway.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)