{"id":121,"date":"2012-06-30T14:59:07","date_gmt":"2012-06-30T14:59:07","guid":{"rendered":"http:\/\/www.nywzjs.com\/?p=121"},"modified":"2012-06-30T15:20:41","modified_gmt":"2012-06-30T15:20:41","slug":"asp%e3%80%81php%e5%92%8cjs%e6%a0%b9%e6%8d%ae%e5%9f%9f%e5%90%8d%e8%bd%ac%e7%a7%bb%e7%bd%91%e5%9d%80%e7%9a%84%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.nywzjs.com\/?p=121","title":{"rendered":"ASP\u3001PHP\u548cJS\u6839\u636e\u57df\u540d\u8f6c\u79fb\u7f51\u5740\u7684\u529e\u6cd5"},"content":{"rendered":"<figure id=\"attachment_127\" aria-describedby=\"caption-attachment-127\" style=\"width: 150px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2012\/06\/20120630231723.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-thumbnail wp-image-127\" title=\"20120630231723\" src=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2012\/06\/20120630231723-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" \/><\/a><figcaption id=\"caption-attachment-127\" class=\"wp-caption-text\">301\u91cd\u5b9a\u4f4d<\/figcaption><\/figure>\n<p>\u5728\u7f51\u7ad9\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u4f7f\u7528\u4e0d\u540c\u57df\u540d\u8bbf\u95ee\u540c\u4e00\u7f51\u7ad9\u800c\u8c03\u7528\u4e0d\u540c\u9875\u9762\u7684\u95ee\u9898\uff0c\u4eca\u5929\u6574\u7406\u51faASP\u3001PHP\u548cJS\u4e09\u79cd\u8bed\u8a00\u6839\u636e\u57df\u540d\u8fdb\u884c\u8f6c\u79fb\u7684\u65b9\u6cd5\uff0c\u5176\u4e2dASP\u548cPHP\u4f7f\u7528\u7684\u662f301\u91cd\u5b9a\u4f4d\u3002<\/p>\n<p>ASP\uff1a<\/p>\n<p style=\"padding-left: 30px;\">\u57fa\u7840\u8bed\u53e5\u4e3a\uff1a<\/p>\n<p style=\"padding-left: 30px;\">Response.Status = \"301 Moved Permanently\"<br \/>\nResponse.AddHeader \"Location\",\"url\"<\/p>\n<p style=\"padding-left: 30px;\">\u5177\u4f53\u5b9e\u4f8b\u4e3a\uff1a<\/p>\n<pre>\u3000&lt;%\r\n\u3000\u3000if Request.ServerVariables(\"SERVER_NAME\")=\"aaa.com\" then\r\n\u3000\u3000Response.Status = \"301 Moved Permanently\"\r\n\u3000\u3000Response.AddHeader \"Location\",\"http:\/\/www.bbb.com\"\r\n\u3000\u3000elseif Request.ServerVariables(\"SERVER_NAME\")=\"www.aaa.com\" then\r\n\u3000\u3000Response.Status = \"301 Moved Permanently\"\r\n\u3000\u3000Response.AddHeader \"Location\",\"http:\/\/www.bbb.com\"\r\n\u3000\u3000end if\r\n\u3000\u3000%&gt;<\/pre>\n<pre>PHP\uff1a<\/pre>\n<pre style=\"padding-left: 30px;\">\u57fa\u7840\u8bed\u53e5\u4e3a\uff1a<\/pre>\n<pre style=\"padding-left: 30px;\">Header( \"HTTP\/1.1 301 Moved Permanently\" );\u00a0\r\nHeader( \"Location: http:\/\/www.hebi99.com\/\" );<\/pre>\n<pre style=\"padding-left: 30px;\">\u5177\u4f53\u5b9e\u4f8b\u4e3a\uff1a<\/pre>\n<pre style=\"padding-left: 30px;\">&lt;?php \u00a0\u00a0\r\n$the_host = $_SERVER['HTTP_HOST'];\/\/\u53d6\u5f97\u8fdb\u5165\u6240\u8f93\u5165\u7684\u57df\u540d\r\n$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';\/\/\u5224\u65ad\u5730\u5740\u540e\u9762\u90e8\u5206\r\nif($the_host !== 'www.gcidc.net')\/\/\u8fd9\u662f\u6211\u8981\u4ee5\u524d\u7684\u57df\u540d\u5730\u5740\r\n{\r\n\u00a0 header('HTTP\/1.1 301 Moved Permanently');\/\/\u53d1\u51fa301\u5934\u90e8\u00a0\r\n\u00a0 header('Location: http:\/\/www.xxx.net'.$request_uri);\/\/\u8df3\u8f6c\u5230\u6211\u7684\u65b0\u57df\u540d\u5730\u5740\r\n}\r\n?&gt;<\/pre>\n<pre>JS\uff1a<\/pre>\n<pre style=\"padding-left: 30px;\">\u57fa\u7840\u8bed\u53e5\u4e3a\uff1a<\/pre>\n<pre style=\"padding-left: 30px;\">window.location=\"\/wap\/\";<\/pre>\n<pre style=\"padding-left: 30px;\">\u5177\u4f53\u5b9e\u4f8b\u4e3a\uff1a<\/pre>\n<pre style=\"padding-left: 30px;\">&lt;script language=\"javascript\"&gt;\r\n   var locname=location.hostname;\r\n   if ((locname==\"wap.hebi99.com\")||(locname==\"3g.hebi99.com\"))\r\n      {\r\n        window.location=\"\/wap\/\";\r\n      }\r\n&lt;\/script&gt;<\/pre>\n<pre>\u901a\u8fc7\u4e0a\u9762\u7684\u5b9e\u4f8b\u6211\u4eec\u53ef\u4ee5\u5b9e\u73b0\u5f88\u591a\u7684\u529f\u80fd\uff0c\u4f8b\u59823G\u7f51\u5740\u7684\u8f6c\u79fb\uff0cHelp\u9875\u9762\u7684\u8f6c\u79fb\u7b49\uff0c\u7701\u53bb\u8f83\u957f\u7684URL\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u66f4\u7b80\u6d01\u7684\u4e0a\u7f51\u4f53\u9a8c\u3002<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7f51\u7ad9\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u4f7f\u7528\u4e0d\u540c\u57df\u540d\u8bbf\u95ee\u540c\u4e00\u7f51\u7ad9\u800c\u8c03\u7528\u4e0d\u540c\u9875\u9762\u7684\u95ee\u9898\uff0c\u4eca\u5929\u6574\u7406\u51faASP\u3001PHP\u548cJS\u4e09\u79cd\u8bed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[47,44,46,45,48],"_links":{"self":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/121"}],"collection":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":0,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}