在阿里云ecs上部署WordPress时,遇到一个同源策略问题

WBOY
Release: 2016-06-06 20:15:49
Original
1265 people have browsed it

在阿里云ecs上部署WordPress时,遇到一个同源策略问题。当前使用的wp主题使用了主题自带的字体文件,当使用ip地址直接访问时,字体文件可以正常加载,但换到域名访问时就出现了跨源请求资源的问题。
windows下的firefox,chrome都出现了上述问题,但是移动端访问正常。

下面贴出浏览器console记录

<code>22:51:46.885 已拦截跨源请求:同源策略禁止读取位于 http://120.27.100.154/blog/wp-content/themes/Puma-plus-master/static/fonts/icomoon.ttf?jh4rkv 的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin')。1 </code>
Copy after login
Copy after login

回复内容:

在阿里云ecs上部署WordPress时,遇到一个同源策略问题。当前使用的wp主题使用了主题自带的字体文件,当使用ip地址直接访问时,字体文件可以正常加载,但换到域名访问时就出现了跨源请求资源的问题。
windows下的firefox,chrome都出现了上述问题,但是移动端访问正常。

下面贴出浏览器console记录

<code>22:51:46.885 已拦截跨源请求:同源策略禁止读取位于 http://120.27.100.154/blog/wp-content/themes/Puma-plus-master/static/fonts/icomoon.ttf?jh4rkv 的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin')。1 </code>
Copy after login
Copy after login

问题已解决,WordPress忘了将地址改过来了,之前是将IP作为地址的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!