{"id":27727,"date":"2024-11-24T16:17:08","date_gmt":"2024-11-24T08:17:08","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27727\/"},"modified":"2024-11-24T16:17:08","modified_gmt":"2024-11-24T08:17:08","slug":"%e4%bb%8e-b-%e7%bd%91%e9%a1%b5%e8%b7%b3%e8%bd%ac%e5%88%b0-a-%e7%bd%91%e9%a1%b5%e5%90%8e%ef%bc%8ca-%e7%bd%91%e9%a1%b5%e5%8f%91%e8%b5%b7%e7%9a%84%e5%bc%82%e6%ad%a5%e8%af%b7%e6%b1%82%e6%98%af%e5%90%a6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27727\/","title":{"rendered":"\u4ece B \u7f51\u9875\u8df3\u8f6c\u5230 A \u7f51\u9875\u540e\uff0cA \u7f51\u9875\u53d1\u8d77\u7684\u5f02\u6b65\u8bf7\u6c42\u662f\u5426\u4f1a\u643a\u5e26 referer \u5c5e\u6027\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173130931777335.jpg\" class=\"aligncenter\" title=\"\u4ece B \u7f51\u9875\u8df3\u8f6c\u5230 A \u7f51\u9875\u540e\uff0cA \u7f51\u9875\u53d1\u8d77\u7684\u5f02\u6b65\u8bf7\u6c42\u662f\u5426\u4f1a\u643a\u5e26 referer \u5c5e\u6027\uff1f\u63d2\u56fe\" alt=\"\u4ece B \u7f51\u9875\u8df3\u8f6c\u5230 A \u7f51\u9875\u540e\uff0cA \u7f51\u9875\u53d1\u8d77\u7684\u5f02\u6b65\u8bf7\u6c42\u662f\u5426\u4f1a\u643a\u5e26 referer \u5c5e\u6027\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5f53 a \u7f51\u9875\u4ece b \u7f51\u9875\u8df3\u8f6c\u540e\uff0ca \u7f51\u9875\u53d1\u8d77\u5f02\u6b65\u8bf7\u6c42\u662f\u5426\u643a\u5e26 referer \u5c5e\u6027\uff1f<\/strong><\/p>\n<p>\u56de\u7b54\uff1a\u662f\u7684\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5982\u679c A \u7f51\u9875\u662f\u4ece B \u7f51\u9875\u8df3\u8f6c\u800c\u6765\u7684\uff0c\u90a3\u4e48 A \u7f51\u9875\u53d1\u8d77\u7684\u5f02\u6b65\u8bf7\u6c42\u4f1a\u643a\u5e26 referer \u5c5e\u6027\u3002\u5b83\u662f\u4e00\u4e2a HTTP \u8bf7\u6c42\u5934\uff0c\u7528\u4e8e\u6807\u8bc6\u5c06\u7528\u6237\u5b9a\u5411\u5230\u5f53\u524d\u9875\u9762\u7684\u9875\u9762\u3002<\/p>\n<p>\u7136\u800c\uff0c\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u9009\u62e9\u4e0d\u643a\u5e26 referer \u5c5e\u6027\uff1a<\/p>\n<p><strong>1. \u5728 A \u7f51\u7ad9\u9875\u9762\u5934\u90e8\u52a0\u5165 meta \u6807\u7b7e\uff1a<\/strong><\/p>\n<pre>&lt;meta name=\"referrer\" content=\"no-referrer\" \/&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u5c06\u963b\u6b62\u4efb\u4f55\u8df3\u8f6c\u643a\u5e26 referer\u3002<\/p>\n<p><strong>2. \u4f7f\u7528 window.open \u79fb\u9664 referer\uff1a<\/strong><\/p>\n<pre>window.open('javascript:window.name;','&lt;script&gt;location.replace(\"' + your-redirect-url + '\")&lt;\/script&gt;');<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u5c06\u5728\u4e0d\u4f20\u9012 referer \u7684\u60c5\u51b5\u4e0b\u6253\u5f00\u4e00\u4e2a\u65b0\u7a97\u53e3\u3002<\/p>\n<p><strong>3. \u4f7f\u7528 iframe\uff1a<\/strong><\/p>\n<pre>document.body.appendChild(document.createElement('iframe')).src='javascript:\"&lt;script&gt;top.location.replace('' + your-redirect-url + '')&lt;\/script&gt;\"';<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u4e0d\u53ef\u89c1\u7684 iframe\uff0c\u8be5 iframe \u5c06\u66ff\u6362\u5176\u4f4d\u7f6e\u7684\u5185\u5bb9\uff0c\u540c\u65f6\u4e0d\u4f20\u9012 referer\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4ece B \u7f51\u9875\u8df3\u8f6c\u5230 A \u7f51\u9875\u540e\uff0cA \u7f51\u9875\u53d1\u8d77\u7684\u5f02\u6b65\u8bf7\u6c42\u662f\u5426\u4f1a\u643a\u5e26 referer \u5c5e\u6027\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53 a \u7f51\u9875\u4ece b \u7f51\u9875\u8df3\u8f6c\u540e\uff0ca \u7f51\u9875\u53d1\u8d77\u5f02\u6b65\u8bf7\u6c42\u662f\u5426\u643a\u5e26 referer \u5c5e\u6027\uff1f \u56de\u7b54\uff1a\u662f\u7684\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5982\u679c A \u7f51\u9875\u662f\u4ece B \u7f51\u9875\u8df3\u8f6c\u800c\u6765\u7684\uff0c\u90a3\u4e48 A \u7f51\u9875\u53d1\u8d77\u7684\u5f02\u6b65\u8bf7\u6c42\u4f1a\u643a\u5e26 referer \u5c5e\u6027\u3002\u5b83\u662f\u4e00\u4e2a HTTP \u8bf7\u6c42\u5934\uff0c\u7528\u4e8e\u6807\u8bc6\u5c06\u7528\u6237\u5b9a\u5411\u5230\u5f53\u524d\u9875\u9762\u7684\u9875\u9762\u3002 \u7136\u800c\uff0c\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u9009\u62e9\u4e0d\u643a\u5e26 referer \u5c5e\u6027\uff1a 1. \u5728 A \u7f51\u7ad9\u9875\u9762\u5934\u90e8\u52a0\u5165 meta \u6807\u7b7e\uff1a &lt;meta name=&#8221;referrer&#8221; content=&#8221;no-referrer&#8221; \/&gt; \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u963b\u6b62\u4efb\u4f55\u8df3\u8f6c\u643a\u5e26 referer\u3002 2. \u4f7f\u7528 window.open \u79fb\u9664 referer\uff1a window.open(&#8216;javascript:window.name;&#8217;,'&lt;script&gt;location.replace(&#8220;&#8216; + your-redirect-url + &#8216;&#8221;)&lt;\/script&gt;&#8217;); \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u5728\u4e0d\u4f20\u9012 referer \u7684\u60c5\u51b5\u4e0b\u6253\u5f00\u4e00\u4e2a\u65b0\u7a97\u53e3\u3002 3. \u4f7f\u7528 iframe\uff1a document.body.appendChild(document.createElement(&#8216;iframe&#8217;)).src=&#8217;javascript:&#8221;&lt;script&gt;top.location.replace(&#8221; + your-redirect-url [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27727","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27727"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27727\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}