mz

web.config模板

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<system.webServer>
		<!--start-php-->
		<handlers>
			<remove name="php_5.2" />
			<remove name="php_5.3" />
			<remove name="php_5.4" />
			<remove name="php_5.5" />
			<remove name="php_5.6" />
			<remove name="php_7.0" />
			<remove name="php_7.1" />
			<add name="php_7.1" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="D:\BtSoft\WebSoft\php\7.1\php-cgi.exe" resourceType="Unspecified" requireAccess="Script" />
			<remove name="PageHandlerFactory-ISAPI-2.0-64" />
			<remove name="PageHandlerFactory-ISAPI-2.0" />
			<remove name="SimpleHandlerFactory-ISAPI-2.0-64" />
			<remove name="SimpleHandlerFactory-ISAPI-2.0" />
			<remove name="ASPClassic" />
		</handlers>
		<!--end-php-->
					
		<!--start-rewrite-->
		<rewrite>  
		  <rules>  
			<rule name="WPurls" enabled="true" stopProcessing="true">  
			  <match url=".*" />  
			  <conditions logicalGrouping="MatchAll">  
				<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />  
				<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />  
			  </conditions>  
			  <action type="Rewrite" url="index.php/{R:0}" />  
			</rule>  
		  </rules>  
		</rewrite>  
		<httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough"></httpErrors>
        <defaultDocument>
            <files>
                <remove value="Default.htm" />
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.html" />
                <remove value="index.htm" />
                <remove value="Default.asp" />
                <remove value="default.html" />
                <remove value="index.asp" />
                <remove value="index.aspx" />
            </files>
        </defaultDocument>  
		<!--end-rewrite-->	
	</system.webServer>
</configuration>

 

码字很辛苦,转载请注明来自明志博客《web.config模板》

评论