{"id":1851,"date":"2015-06-04T12:14:10","date_gmt":"2015-06-04T04:14:10","guid":{"rendered":"http:\/\/www.gejoin.com\/?p=1851"},"modified":"2015-06-04T12:14:10","modified_gmt":"2015-06-04T04:14:10","slug":"no-access-control-allow-origin-%e9%97%ae%e9%a2%98%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/www.mujins.com\/?p=1851","title":{"rendered":"No Access-Control-Allow-Origin \u95ee\u9898\u89e3\u51b3"},"content":{"rendered":"<blockquote><p>Font from origin &#8216;http:\/\/www.ingressplus.com&#8217; has been blocked from loading by Cross-Origin Resource Sharing policy: No &#8216;Access-Control-Allow-Origin&#8217; header is present on the requested resource. Origin &#8216;http:\/\/ingressplus.com&#8217; is therefore not allowed access.<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p>\u6700\u8fd1\u5c06\u4e00\u4e2a\u7f51\u7ad9\u8fc1\u79fb\u5230\u65b0\u7684VPS\uff0c\u6570\u636e\u5e93\uff0c\u6587\u4ef6\u5907\u4efd\u540e\u90e8\u7f72\u9047\u5230\u4e86\u8bb8\u591a\u5947\u5947\u602a\u602a\u7684\u95ee\u9898\uff0c\u4f46\u5927\u591a\u90fd\u662f\u73af\u5883\u914d\u7f6e\u95ee\u9898\uff0c\u7531\u4e8e\u8981\u5728\u4e3b\u673a\u90e8\u7f72\u591a\u4e2a\u7f51\u7ad9\uff0c\u8fd9\u91cc\u7528\u5230\u4e86VirtualHost.<\/p>\n<pre>\u00a0 \u00a0 DocumentRoot\u00a0\/var\/www\/html\/chyrp\n\u00a0 \u00a0 ServerName\u00a0www.ingressplus.com\n\u00a0 \u00a0 ServerAlias\u00a0*.ingressplus.com\n\u00a0 \u00a0 ErrorLog\u00a0logs\/error_log\n\u00a0 \u00a0 CustomLog\u00a0logs\/access_log\u00a0common\n<\/pre>\n<p><a href=\"https:\/\/www.gigiwangs.com\/wp-content\/uploads\/2015\/06\/protocolo-http.jpg\" data-lightbox=\"gal[1851]\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1852\" src=\"https:\/\/www.gigiwangs.com\/wp-content\/uploads\/2015\/06\/protocolo-http.jpg\" alt=\"protocolo-http\" width=\"600\" height=\"394\" \/><\/a><br \/>\n1.\u89e3\u51b3403\u95ee\u9898\u540e,\u7f51\u7ad9\u4e3b\u9875\u53ef\u4ee5\u6253\u5f00\uff0c\u4f46\u6240\u6709\u94fe\u63a5(\u7ad9\u5185)\u90fd404,\u7f51\u7ad9\u914d\u7f6e\u95ee\u9898\uff0c\u4f7f\u7528chyrp\u91cd\u65b0\u5b89\u88c5\uff0c\u5f53\u7136\u6570\u636e\u5e93\u8868\u6570\u636e\u4e0d\u8981\u5220\u9664\uff0c\u6587\u4ef6\u4e0d\u8981\u5220\u9664\uff0c\u53ea\u8981\u5728\/includes\/\u76ee\u5f55\u4e0b\u65b0\u751f\u6210config.yaml.php \u914d\u7f6e\u6587\u4ef6\uff0c\u662f\u6570\u636e\u5e93\u548c\u57fa\u672c\u7684\u914d\u7f6e\u3002\u66f4\u6539.htaccess \u6587\u4ef6:<\/p>\n<pre>\nRewriteEngine On\nRewriteBase \/\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^.+$ index.php [L]\nRewriteCond %{HTTP_HOST} !^www.siteX.com [NC]\nRewriteRule ^(.*)$ http:\/\/www.siteX.com\/$1 [L,R=301]\n<\/pre>\n<p>2.\u7f51\u7ad9\u4e2d\u7279\u6b8a\u5b57\u4f53\uff08social-font)\u4f7f\u7528\u5e26www\u57df\u540d\u8bbf\u95ee\u6b63\u5e38\u52a0\u8f7d\uff0c\u4f46\u4f7f\u7528\u4e0d\u5e26www\u7684\u57df\u540d\u8bbf\u95ee\u5219\u4e0d\u52a0\u8f7d\uff0c\u901a\u8fc7Chrome\u8c03\u8bd5\uff0c\u770b\u5230\u62a5\u9519\u4fe1\u606f:Cross-Origin Resource Sharing policy: No &#8216;Access-Control-Allow-Origin&#8217; header&#8230; \u53cd\u590d\u67e5\u8d44\u6599\u66f4\u6539,\u901a\u5e38\u5728\u4f7f\u7528CDN\u4f1a\u51fa\u73b0\u8fd9\u79cd\u8bbf\u95ee\u6743\u9650\u95ee\u9898\uff0c\u5e26www\u7684url\u548c\u4e0d\u5e26www\u5bf9\u540c\u4e00\u4e2acss\u540c\u8def\u5f84\u6587\u4ef6\u6743\u9650\u4e0d\u4e00\u6837\u7684..\u5728.htaccess \u6587\u4ef6\u6dfb\u52a0\u5185\u5bb9\uff1a<br \/>\n&lt;ifmodule mod_headers.c&gt;<br \/>\n&lt;filesmatch \u201c\\.(ttf|ttc|otf|eot|woff|font.css|css)$\u201d&gt;<br \/>\nHeader set Access-Control-Allow-Origin \u201c*\u201d<br \/>\n&lt;\/filesmatch&gt;<br \/>\n&lt;\/ifmodule&gt;<br \/>\n\u7ed3\u679c\u65e0\u6548&#8230;.\u5c06\u8fd9\u4e9b\u5185\u5bb9\u7c98\u8d34\u5230\/etc\/httpd\/conf\/httpd.conf \u4e2d\uff0c\u91cd\u65b0\u52a0\u8f7dapache.\u6210\u529f\u89e3\u51b3\u95ee\u9898&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Font from origin &#8216;http:\/\/www.ingressplus.com&#8217; has been blocked from loading by Cross-Origin Resource Sharing policy: No &#8216;Access-Control-Allow-Origin&#8217; header is present on the requested resource. Origin &#8216;http:\/\/ingressplus.com&#8217; is therefore not allowed access. &nbsp; \u6700\u8fd1\u5c06\u4e00\u4e2a\u7f51\u7ad9\u8fc1\u79fb\u5230\u65b0\u7684VPS\uff0c\u6570\u636e\u5e93\uff0c\u6587\u4ef6\u5907\u4efd\u540e\u90e8\u7f72\u9047\u5230\u4e86\u8bb8\u591a\u5947\u5947\u602a\u602a\u7684\u95ee\u9898\uff0c\u4f46\u5927\u591a\u90fd\u662f\u73af\u5883\u914d\u7f6e\u95ee\u9898\uff0c\u7531\u4e8e\u8981\u5728\u4e3b\u673a\u90e8\u7f72\u591a\u4e2a\u7f51\u7ad9\uff0c\u8fd9\u91cc\u7528\u5230\u4e86VirtualHost. \u00a0 \u00a0 DocumentRoot\u00a0\/var\/www\/html\/chyrp \u00a0 \u00a0 ServerName\u00a0www.ingressplus.com \u00a0 \u00a0 ServerAlias\u00a0*.ingressplus.com \u00a0 \u00a0 ErrorLog\u00a0logs\/error_log \u00a0 \u00a0 CustomLog\u00a0logs\/access_log\u00a0common 1.\u89e3\u51b3403\u95ee\u9898\u540e,\u7f51\u7ad9\u4e3b\u9875\u53ef\u4ee5\u6253\u5f00\uff0c\u4f46\u6240\u6709\u94fe\u63a5(\u7ad9\u5185)\u90fd404,\u7f51\u7ad9\u914d\u7f6e\u95ee\u9898\uff0c\u4f7f\u7528chyrp\u91cd\u65b0\u5b89\u88c5\uff0c\u5f53\u7136\u6570\u636e\u5e93\u8868\u6570\u636e\u4e0d\u8981\u5220\u9664\uff0c\u6587\u4ef6\u4e0d\u8981\u5220\u9664\uff0c\u53ea\u8981\u5728\/includes\/\u76ee\u5f55\u4e0b\u65b0\u751f\u6210config.yaml.php \u914d\u7f6e\u6587\u4ef6\uff0c\u662f\u6570\u636e\u5e93\u548c\u57fa\u672c\u7684\u914d\u7f6e\u3002\u66f4\u6539.htaccess \u6587\u4ef6: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1852,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[11,13],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts\/1851"}],"collection":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1851"}],"version-history":[{"count":0,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts\/1851\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}