Site logo

Archived topic

Access-Control errors - missing search icon

11 replies · Started by Charles on August 14, 2018

Viewing posts 1–12 of 12

Hi Tom,

I'm getting the Access-Control console errors on my WordPress site, and the search icon is missing. I tried the chosen solution to add Access-Control to .htaccess but it didn't work - in fact it completely broke the site. It could be that I put the .htaccess code in the wrong place, since in WordPress there are at least 3 places where you can place an .htaccess file.

I also tried installing a font awesome plugin, which I would have thought would give access, but it didn't do anything. I thought I saw somewhere in an old post that you were going to build font awesome into the theme so it doesn't rely on a CDN link.

Anyway, how can I fix the errors on my site?

Actually I see it's there on the https:// version - it's just in http:// - so I'm going to contact my host provider and ask them why there are two separate versions.

Thanks
Charles

That's what I was referring to. I already found that page, where Tom posted this link https://davidwalsh.name/cdn-fonts to the page about the .htaccess file solution. I tried adding that code in the .htaccess file in my WordPress installation folder and it broke the whole css layout.

It seems to be intermittently working now that an SSL certificate has been installed. On some page loads it appears, on some it doesn't.

Charles
https://southeglinton.ca/ - beside Twitter icon in menu.

For some reason the icons are being looked up without the www which your site uses.

What URLs do you have set in "Settings > General"? With www or without?

I just had an SSL certificate installed and I changed the settings in General to https://www.southeglinton.ca

However, the named permalinks aren't working, so for now as a workaround I changed them to the plain ones. I changed the URLs in 'wp_options' in the db to https but that hasn't fixed it yet. I used to have a list of the exact fields in the db to change URLs when migrating a site manually, but I can't find it. Do you happen to know where that is?

Charles

The ones in wp_options should be it.

Does your server have any non-www to www redirecting?

Yes it does. There's something else going on that I can't figure out, only on the home page. Because now that I have set the permalinks to plain it has reverted to the insecure icon - but just on the home page. If I put the permalinks back to the named ones the home page icon goes green but the links to the article posts don't work. The articles are in custom post types - maybe there's a separate linking in the db to those.

The insecure notice is happening because the page contains a form that targets an insecure endpoint (http://youurl.com/serra-calendar).

Perhaps contact your hosting about the other issue. If they inspect your site in developer tools, they will see that all font-related resources are being loaded without the www. Perhaps there's a server setting that needs to be tweaked.

Since you're using www, all of the resources need to load using www as well.

If you have resources loading without www, you'll run into errors like this.

None of the htaccess solutions worked. What did work, as you pointed out, was removing www from the site URLs.

Might be an idea in future when this comes up to tell people to just remove www - there are a lot of "solutions" in your forum and online with various htaccess code suggestions, many of which just removed all css code, and none of them had any affect on font awesome.

Thanks Tom

Charles

Be sure to set up a 301 redirect from www to no-www :)

Glad I could help!

This archived topic is closed to new replies.