可以在 Dreamhost 中设置 Access-Control-Allow-Origin 吗?
只是想确认这一点:Firefox 目前在通过 font-face 标签通过子域选择自定义字体方面表现不佳。其他浏览器执行此操作没有任何问题。
一些研究显示,我需要设置 Access-Control-Allow-Origin,如链接所示: http://pastie.org/653265
本质上,我的博客位于 kaushikgopal.com/blog,我试图 访问此博客中可用的字体 font.kaushikgopal.com。我尝试在 .htaccess 文件中更改相同的内容,但无法解决问题。(我将 .htaccess 文件放置在字体子域文件夹中,并直接从上面的粘贴链接粘贴代码)。
我向 dreamhost 提交了一张请求帮助的票,他们帮助清楚地说明了“我们不支持共享托管服务器上的 Access-Control-Allow-Origin”。
所以我没有走字体的子域路线。但我有点好奇,有没有人尝试过这个(使用 dreamhost 托管帐户会有所帮助)?只是想确认技术支持人员的建议是否准确,没有其他办法。
谢谢。
另一个很好的链接清楚地说明了问题: http://www.stevesouders.com/tests/font-face/xdomain。 php
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚尝试过,它确实有效(在 Dreamhost 上)。例如,/mysite/pub/.htaccess:
标头添加 Access-Control-Allow-Origin *
请参阅 http ://42at.com/lab/Thumboard/bookmarklet.html。小书签对我的域进行 ajax 调用,并且通过上述访问控制能够获取 html 片段。
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.