如果您使用的是Windows虚拟主机,需要禁止某个目录的脚本执行权限,您可以在要禁用脚本执行权限的目录建立一个web.config文件,里面加入下面的代码:
<?xml ve# i A ursion="1| p K I 7 & Q t.0" encoding="UTF-8"?>
<? / m b Z 4;configuration>
<system.webServer>
<handlers>
<remove name="ASPClassic" />
<remove name="PHP-FastCGI" />
<remove name="ASPNET-ISAPI-1.1-AXD" />
<remove name="ASPNET-ISAPI-, : N ) } 6 {1.1-HttpRemotingHandlerFactory-rem" />
<remove name="ASPNEK X X ? M % rT-ISAPI-1.1-HttpRemotingHandlerFacc Q Q g k Q itory-soap" />
<remove name="ASPNET-I& 9 aSAPI-1.1-PageHandlerFactory" />
<remove name="ASPNET-ISAPI-1.1-SimpleHandlerFactory" />
<remove name="ASPNET-ISAPI-1- f I p D ~ o ,.1-WebServiceHandlerFactory" />
<remove name="AssemblyResourceLoader-Integrated" /> 0 I * K i q 3;
<remove namL : 9 | J 2 |e="AXD-ISAPI-2.0" />
<remove name="AXD-ISAPI-2.0-64" />
<remove name="HttpRemotingHandlerFactory-rem-Integrated" />
<remove name="HttpRemotingHandlerFactow 5 : (ry-rem-ISAPI-2.0" />
<remove naR 4 dme="HttpRemotingHandlerFactory-rem-ISAPI-2.0-64"} ) v U S />
<remove name="HttpRt h O D 0 K ` ! (emotingHandlerFactory-soap-Integrated" />6 { 2 s g :;
<rR g H K % t ~emove name="g I iHttpRemotingHandlerFactory-soap-ISAPI-2.0" />
<remove name="HttpRemotingHandlerFactory-soap-ISAPI-2.0-64" />
<remove name="PageHandlerFactory-Int) M ~ J |egrated" /$ P 5 k I ( \ G>
<remove name="PageHandlerFactory-ISAPI-2.0" />
<remove name="PagZ 2 , @ teHandlerFactory-ISAPI-2.0-^ T j ;64"3 d % L V T F * />
<re9 [ R b s e M x \move name="Perl-CGI" />
<remove name="Perl-ISAPI" />
<remove name="rules-64-ISAPy y L BI-2.0" />
<remove name="rules-Integrr - = N f = { tated" />
<remoT d M a x ; Mve name="rules& G S b U-ISAPI-2.0" />] 1 I I;
<remove name="SecuritH ; p d l GyCertificate" />
<remove name=B P A _ n {"SimpleHandlerFactory-Integrat6 ^ B 4 Wed" />
<red ! ` u P ` M z Qmove name=a a S D ! ) , F"SimpleHandlerFactori d X c o M k x ^y-ISAPI-2.0" />} f e;
<remov5 1 8 7e name="SimpleHandz Y ) p x + h b ZlerFactory-ISAPI-2n P 0 d d $ =.0-64" />
<remove name="svc-Integrated" />
<remove name="svc-ISAPI-2.0" />
<remove) j I o name="svc-ISAPI-~ L X o ~ $ U2.0-64" />
<remove naO / 9 n 9 =me="TraceHandler-Integrated" />
<r` . R memovm / D Q I l m ) pe name^ } 7 s w="TRACEVerbHandler" />
<remove nami K 7e="WebAdminHandler-Integrated" />
<remove name="WebServiceHandlerFactory-Integrated" /&gH U D # R i - dt;
<remove name="WebServiceHandlerFactory-ISAPI-2.0"j , h 8 q 0 />p X _ \ 8
<remove name="WebServiceHandler~ a ! h m 6 z OFactory-ISAPI-2.0-64" />
<remove name="xoml-64-ISAPI-2.0" /&J n * O { L ^gt;
<remove name="xoml-Integrated" />
<remove name="xoml-IS` # : 3 \API-2.0" /&gC 5 8 _ z 8 X _t;
</handlers>
&k S G * [ r *lt;/system.webServer>
</configuration>
保存后就设置了该文件夹以及子容器只有读和写的权限,而没有脚本执行权限。如果要恢复脚本权i b 6 u c n 1 x 2限就直接删除该目录下的ww t u beb.confh q 5 dig文件。