{"id":615,"date":"2006-06-06T20:41:47","date_gmt":"2006-06-06T08:41:47","guid":{"rendered":""},"modified":"2006-06-06T20:41:47","modified_gmt":"2006-06-06T08:41:47","slug":"","status":"publish","type":"post","link":"https:\/\/www.mudone.com\/?p=615","title":{"rendered":".htaccess \u6587\u4ef6\u7684\u5e94\u7528"},"content":{"rendered":"<p>\u4e00.\u81ea\u5b9a\u4e49404,401,\u7b49\u9519\u8bef <\/p>\n<p>1.\u9996\u5148\u5efa\u7acb\u4e00\u4e2a\u540d\u4e3a: .htaccess<br \/>\n\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9<br \/>\nErrorDocument 401 \/err401.html<br \/>\nErrorDocument 402 \/err402.html<br \/>\nErrorDocument 403 \/err403.html<br \/>\nErrorDocument 404 \/err404.html <\/p>\n<p>\u5176\u4e2d,401,402,403,404\u4ee3\u8868\u9519\u8bef\u7c7b\u578b,<br \/>\n\u540e\u9762\u7684err401.html\u4ee3\u8868\u5176\u76f8\u5bf9\u5e94\u7684\u9875\u9762, <\/p>\n<p>2.\u5206\u522b\u5efa\u7acb\u540d\u5b57\u4e3a:<br \/>\nerr401.html,err402.html&#8230;&#8230;&#8230;<br \/>\n\u7684\u6587\u4ef6,\u5f53\u51fa\u73b0\u5bf9\u5e94\u7684\u9519\u8bef\u7684\u65f6\u5019,<br \/>\n\u5c31\u4f1a\u6307\u5411\u5bf9\u9762\u7684\u9875\u9762 <\/p>\n<p>3.\u4f20\u5230\u6839\u76ee\u5f55\u4e0b,<br \/>\n\u4e5f\u5c31\u662f public_html \u76ee\u5f55\u4e0b<br \/>\n\u4e00\u5207\u5c31OK\u4e86<\/p>\n<p>\u4e8c. \u53bb\u6389\u5e7f\u544a<\/p>\n<p>\u5efa\u4e2a\u6587\u4ef6\u540d .htaccess \u7684\u6587\u4ef6, \u6587\u4ef6\u5185\u5bb9\u5982\u4e0b:<br \/>\nLayoutIgnoreURI *.php<br \/>\n<!--more-->LayoutIgnoreURI *.cgi<br \/>\nLayoutIgnoreURI *.htm<br \/>\nLayoutIgnoreURI *.html <\/p>\n<p>\u5c06 .htaccess \u4e0a\u4f20\u81f3\u7a7a\u95f4\u7684 Public_html \u76ee\u5f55\u4e0b,\u5373\u53ef\u53bb\u6389\u5e7f\u544a! <\/p>\n<p>\u6ce8\u610f *.* \u8fd9\u91cc..\u60f3\u53bb\u90a3\u79cd\u6269\u5c55\u540d\u7684\u6587\u4ef6,\u5c31\u5199\u4e0a\u90a3\u79cd\u6587\u4ef6\u7684\u6269\u5c55\u540d!<br \/>\n\u8fd9\u4e2a\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u53ea\u8981\u5728\u6839\u76ee\u5f55\u52a0\u8fd9\u4e2a\u6587\u4ef6\uff0c\u90a3\u4e48\u6574\u4e2a\u7f51\u7ad9\u90fd\u4e0d\u4f1a\u6709\u5e7f\u544a!<\/p>\n<p>\u4e09\u3001\u7528.htaccess\u9632\u76d7\u94fe\u5b9e\u4f8b<\/p>\n<p>SetEnvIfNoCase Referer &quot;^<a href=\"http:\/\/0o.cn\/\" title=\"http:\/\/0o.cn\/\" target=\"_blank\">http:\/\/0o.cn\/<\/a>&quot; local_ref=1 Order Allow,Deny Allow from env=local_ref Allow from 127.0.0.1<br \/>\n\u8bb0\u5f97\u628a\u57df\u540d\u6362\u6210\u4f60\u7684,\u5982\u679c\u4f60\u7684\u662f<a href=\"http:\/\/abc.abc.com\u7684\u8bdd,\u90a3\u57df\u540d\u7684\u5199\u6cd5\u5c31\u662fhttp:\/\/abc.abc.com\/\" title=\"http:\/\/abc.abc.com\u7684\u8bdd,\u90a3\u57df\u540d\u7684\u5199\u6cd5\u5c31\u662fhttp:\/\/abc.abc.com\/\" target=\"_blank\">http:\/\/abc.abc.com\u7684\u8bdd,\u90a3\u57df\u540d\u7684\u5199\u6cd5\u5c31\u662fhttp:\/\/abc.abc.com\/<\/a><\/p>\n<p>\u56db\u3001\u901a\u8fc7.htaccess \u628a\u6240\u6709\u7684 .php files \u751f\u6210 .html<\/p>\n<p>\u56e0\u4e3a\u52a8\u6001\u7684\u6587\u4ef6.\u4f8b\u5982PHP,\u5f88\u96be\u88abSE\u6536\u5f55.\u6240\u4ee5\u628aPHP\u751f\u6210\u9759\u6001\u7684HTML\u6587\u4ef6\u5c31\u5bb9\u6613\u88abSE\u6536\u5f55.\u53ea\u9700\u8981\u901a\u8fc7\u7b80\u5355\u7684.htaccess\u5c31\u80fd\u505a\u5230\u6b64\u6548\u679c.<\/p>\n<p>Options +FollowSymLinks<br \/>\nRewriteEngine on<br \/>\nRewriteBase \/<br \/>\nRewriteRule ^index.html$ index.php [T=application\/x-httpd-php,L] <\/p>\n<p>\u4e94\u3001\u5c4f\u853dIP\u5730\u5740\u65b9\u6cd5<\/p>\n<p>\u90e8\u5206\u5141\u8bb8.htaccess\u7684\u865a\u62df\u7a7a\u95f4\u4e2d\u5b9e\u73b0IP\u7981\u6b62<\/p>\n<p>\u5efa\u7acb\u4e00\u4e2a.htaccess\u6587\u4ef6\uff0c\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a <\/p>\n<p>#The next line modified by DenyIP<br \/>\norder allow,deny<br \/>\n#The next line modified by DenyIP<br \/>\n#deny from all<br \/>\nallow from all <\/p>\n<p>\u4f8b\u5982:<\/p>\n<p>Order allow,deny<br \/>\nallow from all<br \/>\ndeny from 61.129.81.101<br \/>\ndeny from 61.170.212.<br \/>\n\u4fdd\u5b58\uff0c\u9000\u51fa<br \/>\n\u89e3\u91ca<br \/>\ndeny from 61.129.81.48<br \/>\n\u662f\u5c4f\u853d61.129.81.48\u7684\u5730\u5740<br \/>\ndeny from 61.170.212.<br \/>\n\u662f\u5c4f\u853d61.170.212\u7684\u7f51\u6bb5\u5730\u5740 <\/p>\n<p>\u7b80\u5355\u8bf4\u660e\uff1a <\/p>\n<p>deny from 222. \u7981\u6b62222.XXX.XXX.XXX \u8fd9\u6574\u4e2a\u7f51\u6bb5\u5bf9\u7f51\u7ad9\u7684\u8bbf\u95ee<br \/>\ndeny from 222.254. \u7981\u6b62222.254.XXX.XXX \u5bf9\u7f51\u7ad9\u7684\u8bbf\u95ee<br \/>\ndeny from 222.254.214. \u7981\u6b62222.254.214.XXX \u5bf9\u7f51\u7ad9\u7684\u8bbf\u95ee<br \/>\ndeny from 222.254.214.32 \u7981\u6b62222.254.214.32 \u5bf9\u7f51\u7ad9\u7684\u8bbf\u95ee<\/p>\n<p>\u8fd9\u6837\u7528\u7c7b\u4f3c\u4e8eB\u7c7b\u5730\u5740\u7684\u5f62\u5f0f\u6765\u5c01IP\uff0c\u5982\u679c\u8981\u5c0159.32.0.0\u523059.39.255.255\u6240\u6709\u7684IP\u7684\u8bdd\u5c31\u8981\u51998\u6761deny\u8bed\u53e5\uff0c\u5927\u5bb6\u53ef\u4ee5\u7528deny from 59.32.0.0\/13\u6765\u51cf\u5c11\u4e66\u5199\u91cf\uff0c\u8fd9\u91cc\u6700\u597d\u7528\u7a0b\u5e8f\u6765\u5b9e\u73b0\uff0c\u8981\u4e0d\u7136\u6570\u91cf\u591a\u7684\u8bdd\u5c31\u5f88\u9ebb\u70e6\u3002<\/p>\n<p>FTP\u4e0a\u4f20\u5230mainwebsite_html\u76ee\u5f55\u91cc<br \/>\n\u6539\u540d\u4e3a.htaccess\u7684\u6587\u4ef6\uff0c\u6587\u4ef6\u4f1a\u81ea\u52a8\u6d88\u5931<br \/>\n\u7136\u540e\u5c31\u751f\u6548\u4e86\u3002<br \/>\n\u88ab\u5c4f\u853d\u7684\u5730\u5740\u8bbf\u95ee\u7f51\u7ad9\u4f1a\u51fa\u73b0<br \/>\nForbidden<br \/>\nYou don&#39;t have permission to access \/ on this server.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nApache\/1.3.22 Server at www.\u57df\u540d.com Port 80<br \/>\n\u6ca1\u6709\u88ab\u5c4f\u853d\u7684\u5730\u5740\u80fd\u591f\u6b63\u5e38\u8bbf\u95ee<br \/>\n\u9700\u8981\u4fee\u6539\u7684\u8bdd\uff0c\u53ef\u4ee5\u91cd\u590d\u4e0a\u8ff0\u64cd\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00.\u81ea\u5b9a\u4e49404,401,\u7b49\u9519\u8bef 1.\u9996\u5148\u5efa\u7acb\u4e00\u4e2a\u540d\u4e3a: .htaccess \u5199\u5165\u4ee5\u4e0b\u5185\u5bb9 ErrorDocu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-615","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=615"}],"version-history":[{"count":0,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/615\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}