Just wanted a confirmation for this: Firefox currently doesn't play well for picking custom fonts through a sub-domain via the font-face tag. Other browsers do this without any problems.
A little research showed up saying that i am required to set the Access-Control-Allow-Origin as is shown in the link here: http://pastie.org/653265
Essentially i have my blog at kaushikgopal.com/blog and i was trying to
access fonts that within this blog that are available at
font.kaushikgopal.com. I tried changing the same in my .htaccess file but couldn't resolve the issue.(I placed a .htaccess file within the font sub-domain folder and directly pasted code from the above pastie link).
I submitted a ticket to dreamhost asking for assistance and they were helpful in clearly stating "We do not support Access-Control-Allow-Origin on shared hosting servers".
So i didn't go the sub-domain route for fonts. But i'm a little curious, has anyone tried this (with a dreamhost hosting account would be helpful)? Just want to confirm what the tech-support guy suggested is accurate and there's no other way.
Thanks.
Another nice link clearly stating the problem :
http://www.stevesouders.com/tests/font-face/xdomain.php
I just tried and it does work (on Dreamhost). Eg, /mysite/pub/.htaccess:
header add Access-Control-Allow-Origin *
See http://42at.com/lab/Thumboard/bookmarklet.html. The bookmarklet does an ajax call to my domain, and with above access-control is able to grab html snippet.
Related
When i brows website using its ip address the style loading fine. But when i try to do it using domain name then style not working. The interesting thing is that i have checked both output html, css source for code and they are 100% same. Then why browser not showing style in domain mode?
direct ip browse- view-source:http://22.199.66.33/
domain browse- view-source:https://www.ogibogi.com/
here i checked both source output code- https://www.diffchecker.com/diff
Any idea how to fix it?
Note: i am using cloudflare with domain.
Note: that this is happening after changing hosting server.
Check the output in your browser's console. There's mixed content error.
Refer to Cloudflare KB on how to troubleshoot mixed content error.
An easy fix is to enable "Always Use HTTPS" and "Automatic HTTPS Rewrite".
The answer from Faiz is correct. Go to the crypto tab and set Automatic HTTPS rewrites to on. But, that will not affect stylesheets or javascript files. And, you have two missing scripts and one missing css file.
To correct those, you'll need to use a relative reference. If you're calling an asset with a full URL, like <img src="http://example.com/image.jpg" />, you would want to change this to <img src="//example.com/image.jpg" />. By removing the http:, the browser will use whichever protocol the visitor is already using. And, on the crypto tab, if you set Always use https to on, that protocol will be https.
I host my own website at home (using wamp) that uses basic authentification. The authentification worked well and username:password in the url worked too. But since last week, when I load url with username:password#url.com it doesn't work and it seems that the css /js data won´t load. I tried this with a bootstrap example site and it worked. So I guess the problem is my website.
Here is my website template, as you can see the CSS doesn´t work except when reloaded.
I don't have this problem at the bootstrap example site (Link)
I use Google Chrome Version 59.0.3071.115 on my computer and it doesn't work on my android phone too.
Edit : it seems that the problem come from the URL. Chrome try to load css with basic authentication in URL and it fail. I've got Provisional headers are shown for the css file.
Do you know why I've got this problem now and how to avoid it ?
I found somebody else with this problem :
Bypass blocking of subresource requests whose URLs contain embedded credentials
Apparently it's a new limitation of chrome :(
When going on your page, I get this warning :
[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass#host/) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.
What is happening there, is that you are doing requests to URLs like :
http://stack:123456#88.182.191.233:8090/[...]
So, since you are sending crenditentials il the URL, Chrome blocks it (returning a (blocked:origin) status)
Edit: By the way, you should never send credentials over URL, especially when you are using http only.
I've got a Silverstripe ran site, which I recently added a SSL certificate to.
Because of this I need to change the HTML Base Element to https from http as now none of the images, stylesheets etc linking correctly and are being rejected as they're not being loaded over https.
I cannot find where this is being set.
I've searched the application code and the database and neither are giving me any luck.
It must be pulling http from somewhere - the question is where?
I understand that silverstripe pulls it's base_tag from the HTML base element.
Does anyone know where this is set for a silverstripe site?
Thanks in advance,
Josh
Just add Director::forceSSL(); to your _config.php
I am not that good at explaining so for example (and this is my actual site), http://securityfenceonline.com/ has a different font on the header menus then http://www.securityfenceonline.com/ does. Basically my question here is how do i get the fonts from the site that starts with www to work on the site that doesn't have a www. My second question is why are there two different urls to access the same website. Thank you so much!!
Coded with: HTML
Uses some Joomla
Newbie at coding
Your DNS entries are configured to point both securityfenceonline.com and www.securityfenceonline.com to the same server. This isn't uncommon. What should be happening though is your server should be configured to 301-redirect one to the other. Otherwise you're creating duplicate content which isn't good for SEO purposes.
The font issue is that you're trying to load a font cross-domain (from www.). You can't do this without the appropriate CORS headers. If you look in your developer console, you should see something like:
Font from origin 'http://www.securityfenceonline.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 'http://securityfenceonline.com' is therefore not allowed access.
If you were to redirect to only one hostname, you wouldn't have this issue. You really should be referencing files in your CSS by relative paths though, as this would also solve the issue.
I've built a Google Chrome Web App for my blog and want to host it on 000webhost. I have a direct link to the .crx file and when the user clicks it, it downloads the file and tries to install, however they get this error: "Apps must be served with content type application/x-chrome-extension". Now after doing much research, I still am not sure how to fix this, I tried adding a meta tag to the head section of the page with the link, I then tried using a PHP header on the page with the link
header('Content-Type: application/x-chrome-extension');
However that did not work either, I then tried adding this line of code to the top of my .htaccess code:
AddType application/x-chrome-extension crx
And you guessed it, it didn't work. I'd really appreciate some help with this, I don't want to pay the $5 just yet, I want to see if people think that it's worth bothering with the app, but I can only do that if my users can download the app!
PS, I get the same error message every time.