{"id":46,"date":"2013-12-21T20:54:35","date_gmt":"2013-12-21T12:54:35","guid":{"rendered":"http:\/\/web.jofar.cn\/?p=46"},"modified":"2013-12-21T20:54:35","modified_gmt":"2013-12-21T12:54:35","slug":"asp%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e6%9c%ac%e7%a9%ba%e9%97%b4%e7%94%a8%e4%bb%a3%e7%a0%81%e5%ae%9e%e7%8e%b0301%e5%ae%9a%e5%90%91%e5%ae%9e%e6%b5%8b%e6%9c%89%e6%95%88","status":"publish","type":"post","link":"https:\/\/web.jofar.cn\/?p=46","title":{"rendered":"asp\u865a\u62df\u4e3b\u673a\u672c\u7a7a\u95f4\u7528\u4ee3\u7801\u5b9e\u73b0301\u5b9a\u5411\u5b9e\u6d4b\u6709\u6548"},"content":{"rendered":"<p><strong><em>\u865a\u62df\u4e3b\u673a\u662f\u4e0d\u80fd\u5728iis\u4e0a\u76f4\u63a5\u505a301\u6c38\u4e45\u91cd\u5b9a\u5411\u7684\u3002\u3002<br \/>\n<\/em><\/strong><\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u5fc5\u987b\u7528\u4ee3\u7801\u6765\u5b9e\u73b0\u6211\u4eec\u7684\u6240\u5e0c\u671b\u7684\u529f\u80fd\u3002<\/p>\n<p><wbr \/><\/p>\n<p>\u9700\u8981\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>\u5982\u679c\u4e0a\u9762\u4ee3\u7801\u590d\u5236\u4e00\u4e2a\u5168\u7ad9\u8c03\u7528\u6587\u4ef6 \u4e00\u822c\u4e3aconfig.asp\u6216header.asp,\u4e5f\u53ef\u4ee5\u662fheader.html\u6587\u4ef6,\u4fdd\u5b58\u5230\u5168\u7ad9\u9700\u8c03\u7528\u5230\u7684\u6587\u4ef6\u5185\u5373\u53ef\u3002\u5b9e\u73b0asp\u5168\u7ad9\u7684301\u8df3\u8f6c\uff01<\/p>\n<p>\u524d\u63d0\u662f\u5168\u7ad9\u662fasp?<wbr \/>\u52a8\u6001\u7f51\u9875\uff01<\/p>\n<p>&lt;%<\/p>\n<p>tulr=&#8221;http:\/\/www.jofar.cn&#8221; &#8216;\u8fd9\u6bb5\u5b9a\u4e49\u8981\u8f6c\u8df3\u5230\u7684\u7f51\u5740<br \/>\ndurl=&#8221;http:\/\/jofar.cn&#8221; &#8216;\u8fd9\u6bb5\u5b9a\u4e49\u9700\u8981\u8f6c\u8df3\u7684\u7f51\u5740<br \/>\nhurl=geturl() &#8216;\u83b7\u53d6\u5f53\u524d\u9875url<br \/>\nif instr(1,hurl,durl,1)&gt;0 then<br \/>\nzurl=replace(hurl,durl,tulr)<br \/>\nResponse.Status=&#8221;301 Moved Permanently&#8221; ? ?&#8217;\u63d0\u793a\u5f53\u524d\u9875\u9762\u8fdb\u884c301\u5b9a\u5411<br \/>\nResponse.AddHeader &#8220;Location&#8221;,zurl<br \/>\nend if<br \/>\n&#8216;\u83b7\u53d6\u5f53\u524durl\u53c2\u6570\u7684\u51fd\u6570<br \/>\nfunction geturl()<br \/>\ndim scriptaddress,servername,qs<br \/>\nscriptaddress = cstr(request.servervariables(&#8220;script_name&#8221;))<br \/>\nservername = cstr(request.servervariables(&#8220;server_name&#8221;))<br \/>\nqs=request.querystring<br \/>\nif qs&lt;&gt;&#8221;&#8221; then<br \/>\ngeturl =&#8221;http:\/\/&#8221;&amp; servername &amp; scriptaddress &amp;&#8221;?&#8221;&amp;qs<br \/>\nelse<br \/>\ngeturl =&#8221;http:\/\/&#8221;&amp; servername &amp; scriptaddress<br \/>\nend if<br \/>\nend function<\/p>\n<p>%&gt;<\/p>\n<p>\u4ee5\u4e0a\u4eb2\u6d4b\u786e\u5b9e\u662f\u8fd4\u56de301\u72b6\u6001<\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>\u5bf9\u4e8e\u9759\u6001\u7684\uff0c\u6ca1\u6709\u4ee3\u7801\u5b9e\u73b0301\u7684\u529e\u6cd5\uff0c\u53ea\u6709\u8df3\u8f6c\uff0c\u8fd4\u56de\u7684\u8fd8\u662f200\uff0c\u4ec5\u662f\u8df3\u8f6c\uff0c\u5982\u4e0b\uff1a<\/em><\/strong><\/p>\n<p>\u9996\u5148\uff0c\u8981\u8bf4\u660e\u4e00\u70b9\uff0c\u6709\u6ca1\u6709\u5fc5\u987b\u8981\u53bb\u505a301\u91cd\u5b9a\u5411\uff0c\u76f8\u4fe1\u8fd9\u4e2a\u7b54\u6848\u6bcf\u4e2a\u4eba\u5fc3\u7406\u90fd\u662f\u5f88\u660e\u767d\u7684\uff0c\u90a3\u5c31\u662f\u5fc5\u987b\u6ef4\uff01\u6362\u57df\u540d\u8981\u505a\uff0c\u4e8c\u7ea7\u57df\u540d\u8981\u505a\uff0c\u5e26\u4e0d\u5e26www\u8981\u505a\uff0c\u603b\u4e4b\uff0c\u505a\u4e86\u6743\u91cd\u5c31\u96c6\u4e2d\u5230\u4e86\u4e00\u4e2a\u9875\u9762\u4e86\uff0c\u767e\u5229\u800c\u65e0\u4e00\u5bb3\u7684\u4e8b\u60c5\uff0c\u5927\u5bb6\u90fd\u559c\u6b22\uff01\u4e0d\u8fc7\u8981\u63d0\u9192\u4e00\u70b9\uff0c\u91cd\u5b9a\u5411\u4e0d\u7b49\u540c\u4e8e\u8df3\u8f6c\uff0c\u5e0c\u671b\u5404\u4f4d\u7ad9\u957f\u614e\u91cd\uff01<br \/>\n\u597d\u4e86\uff0c\u4e0d\u5e9f\u8bdd\uff0c\u770b\u4ee3\u7801:<br \/>\n&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\nif (document.domain ==&#8217;jofar.cn&#8217;)<br \/>\nthis.location = &#8220;http:\/\/www.jofar.cn&#8221; + this.location.pathname + this.location.search;<br \/>\n&lt;\/script&gt;<br \/>\n\u4f60\u53ef\u4ee5\u653e\u5728\u9875\u9762\u91cc\u9762\uff0c\u4e5f\u53ef\u4ee5\u641e\u6210JS\u8c03\u7528\uff0c\u968f\u610f\u64cd\u4f5c\uff01\u4e0d\u8fc7\u4e0a\u9762\u7684\u53ea\u662f\u8df3\u8f6c\u4e0d\u662f301<\/p>\n<p>\u82e5Apache\u4e0d\u652f\u63f4.htaccess\u6216\u4f7f\u7528Windos\u4e3b\u673a\u5546\u65e0\u6cd5\u5e2e\u4f60\u8bbe\u5b9a\uff0c\u90a3\u9759\u6001\u9875\u9762\u7684\u8f6c\u5740\u5c31\u53ea\u80fd\u900f\u8fc7\u5728index.html\u6dfb\u52a0meta refresh tag\u548c\u6807?\u8fde\u7ed3????(canonical tag)\u6765\u8fbe\u6210301\u8f6c\u5740\u3002<\/p>\n<p>\u8bed\u6cd5\u5982\u4e0b\uff1a<br \/>\n&lt;meta http-equiv=&#8221;refresh&#8221; content=&#8221;0; url=http:\/\/www.jofar.cn\/&#8221; \/&gt;<br \/>\n&lt;link rel=&#8221;canonical&#8221; ?\/&gt;<\/p>\n<p>Meta Refresh\u5bb9\u6613\u88ab\u8bef\u4f1a\u6210\u4f5c\u5f0a(SEO SPAM)?<br \/>\n\u5bf9SEO\u7a0d\u6709\u7814\u7a76\u7684\u4eba\u6216\u8bb8\u5bf9meta refresh\u7684\u4f7f\u7528\u6709\u4e9b\u62c5\u5fc3\uff0c\u6015\u4f1a\u8ba9\u641c\u5bfb\u5f15\u64ce\u8bef\u5224?\u4f5c\u5f0a\u3002\u6839\u636e\u6211\u4eec\u7684\u64cd\u4f5c\u7ecf\u9a8c\uff0c\u5176\u5b9e\u53ea\u8981\u6b63\u786e\u7684\u4f7f\u7528\uff0c\u5e76\u4e0d\u7528\u592a\u62c5\u5fc3?????\u6211\u4eec\u4e0d\u662f\u6545\u610f\u6c27\u9020\u4e00\u4e9b\u7528<\/p>\n<p>\u6765\u53d6\u5f97\u6392\u540d\u7684\u9875\u9762\u518d\u8f6c\u5230\u4e0d\u76f8\u5e72\u7684\u7f51\u5740\uff0c\u800c\u4e14Yahoo\u5bf9\u65bcmeta refresh\u7684\u770b\u6cd5\u76f8\u5f53\u65bc301\u8f6c\u5740\uff0c\u4f46Google\u4f1a\u89c6??302\uff0c\u6545\u8fd8\u987b\u52a0\u4e0a\u6807?\u8fde\u7ed3\u5143\u7d20\u544a\u8bc9\u641c\u5bfb????www.jofar.cn\u624d\u662f\u771f\u6b63\u9700<\/p>\n<p>\u8981\u88ab\u7d22\u5f15\u7684\u7f51\u5740\u3002\u800c\u7528rel=&#8221;canonical&#8221;\u76f8\u5f53\u4e8e\u544a\u8bc9\u5f15\u63a3\u4e0a\u9762\u7684\u7f51\u5740\u624d\u662f\u8981\u7d22\u5f15\u7684\u7f51\u5740\uff01\u4e0d\u8fc7\u8fd9\u65b9\u6cd5\u5982\u679c\u662f\u8df3\u5230\u672c\u9875\u9762\u65f6\u4f1a\u9020\u6210\u9875\u9762\u4e0d\u505c\u5730\u5237\u65b0\u3002\u6545\u672c\u4eba\u7528\u7684JS+REL<br \/>\n\u5982\u4e0b\uff1a<br \/>\n&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\nif (document.domain ==&#8217;jofar.cn&#8217;)<br \/>\nthis.location = &#8220;http:\/\/www.jofar.cn&#8221; + this.location.pathname + this.location.search;<br \/>\n&lt;\/script&gt;<br \/>\n&lt;link rel=&#8221;canonical&#8221; ?\/&gt;<br \/>\n\u597d\u8c61\u9759\u6001301\u6ca1\u529e\u6cd5\u505a\u5230\uff0c\u4ee5\u4e0a\u65b9\u6cd5\u53cd\u56de\u7684http\u72b6\u6001\u90fd\u662f200<\/p>\n<p>\u5b9e\u6d4b\u751f\u6548\u7684301\u4ee3\u7801\uff0c\u4e0d\u8fc7\u53ea\u80fd\u8df3\u5230\u9996\u9875\uff0c\u4e0d\u80fd\u5168\u7ad9<br \/>\n&lt;%<br \/>\ncurrentdomain= request.ServerVariables(&#8220;SERVER_NAME&#8221;)<br \/>\nIf currentdomain=&#8221;jofar.cn&#8221; then<br \/>\nResponse.Status=&#8221;301 Moved Permanently&#8221;<br \/>\nResponse.AddHeader &#8220;Location&#8221;,&#8221;http:\/\/www.jofar.cn&#8221;<br \/>\nEnd if<br \/>\n%&gt;<\/p>\n<p>php+iis\u4e0b\u505a301\u4ee3\u7801\u5982\u4e0b\uff08\u5b9e\u6d4bok\uff09\uff1a<\/p>\n<p>&lt;?php<br \/>\n$the_host = $_SERVER[&#8216;HTTP_HOST&#8217;];\/\/\u53d6\u5f97\u8fdb\u5165\u6240\u8f93\u5165\u7684\u57df\u540d<br \/>\n$request_uri = isset($_SERVER[&#8216;REQUEST_URI&#8217;]) ? $_SERVER[&#8216;REQUEST_URI&#8217;] :&#8217; &#8216;;\/\/\u5224\u65ad\u5730\u5740\u540e\u9762\u90e8\u5206<br \/>\nif($the_host !== &#8216;yx.jofar.cn&#8217; )\/\/\u8fd9\u662f\u6211\u8981\u4ee5\u524d\u7684\u57df\u540d\u5730\u5740<br \/>\n{<br \/>\nheader(&#8216;HTTP\/1.1 301 Moved Permanently&#8217;);\/\/\u53d1\u51fa301\u5934\u90e8<br \/>\nheader(&#8216;Location: http:\/\/yx.jofar.cn&#8217;.$request_uri);\/\/\u8df3\u8f6c\u5230\u6211\u7684\u65b0\u57df\u540d\u5730\u5740<br \/>\n}<br \/>\n?&gt;<\/p>\n<p>\u5176\u4e2dif($the_host !== &#8216;www.jofar.cn&#8217; )\u4e2d\u7684\u201c!==\u201d\u662f\u4e0d\u5b8c\u5168\u7b49\u4e8e\u7684\u610f\u601d\uff0c\u4e5f\u53ef\u4ee5\u7528\u201c!=\u201d\u4e0d\u7b49\u4e8e\uff0c\u8fd9\u6837\uff0c\u5c31\u53ef\u4ee5\u5c06\u4ee5\u524d\u7684\u57df\u540d\uff0c\u5305\u62ecjofar.cn\u3001www.jofar.cn \u4ee5\u53ca\u65b0\u57df\u540d\u4e2dwww.isoerp.cn \u5168\u90e8\u91cd\u5b9a\u5411\u5230yx.joafr.cn\u3002\u8fd8\u53ef\u4ee5\u5199\u6210\uff1aif($the_host == \u2019www.joafr.cn\u2019)\u3002<br \/>\n\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u8fd9\u4e2a\u4ee3\u7801\u53ea\u80fd\u5b9e\u73b0\u5f53\u524d\u9875\u9762\u7684\u8df3\u8f6c\uff08\u4e5f\u5c31\u662f\u52a0\u4e86\u4ee3\u7801\u7684\u8fd9\u4e2a\u9875\u9762\u7684\u8df3\u8f6c\uff09\u3002\u8981\u5b9e\u73b0\u6574\u7ad9\u7684\u8df3\u8f6c\uff0c\u5219\u9700\u5728\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6e\u3002<\/p>\n<p>\u5c06\u8fd9\u4e2a\u4ee3\u7801\u653e\u5230\u4f60\u6240\u6709\u7f51\u9875\u7684\u6700\u524d\u9762\uff1a<br \/>\n1.\u76f4\u63a5\u8c03\u7528\uff0c\u628a\u4ee5\u4e0a\u4ee3\u7801\u590d\u5236\u5230\u4e00\u4e2a\u65b0\u6587\u4ef6\u5185\uff0c\u8d77\u540d\u4e3a***.php\uff08\u5982\uff1a301.php\uff09\u3002\u5728\u7f51\u9875\u6587\u4ef6\u4e2d\u8c03\u7528301.php\uff0c\u8c03\u7528\u4ee3\u7801\u4e3a\uff1a&lt;?php include(&#8220;301.php&#8221;); \/\/301\u91cd\u5b9a\u5411 ?&gt;<br \/>\n2.\u628a\u4ee5\u4e0a\u4ee3\u7801\u76f4\u63a5\u6dfb\u52a0\u5230\u9875\u9762\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u865a\u62df\u4e3b\u673a\u662f\u4e0d\u80fd\u5728iis\u4e0a\u76f4\u63a5\u505a301\u6c38\u4e45\u91cd\u5b9a\u5411\u7684\u3002\u3002 \u6240\u4ee5\u6211\u4eec\u5fc5\u987b\u7528\u4ee3\u7801\u6765\u5b9e\u73b0\u6211\u4eec\u7684\u6240\u5e0c\u671b\u7684\u529f\u80fd\u3002 \u9700\u8981\u7684\u4ee3\u7801\u2026 <span class=\"read-more\"><a href=\"https:\/\/web.jofar.cn\/?p=46\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12,5],"tags":[],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-cloud","category-server","category-practice-readme"],"_links":{"self":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=46"}],"version-history":[{"count":0,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts\/46\/revisions"}],"wp:attachment":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}