thinkphp3.1.3从apche移到IIS8.5出现404.0错误

iis下需要重写URL重写规则.
网站根目录下新建web.config,把下面的代码复制进去就哦了

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
		  <rewrite>
				<rules>
					<rule name="OrgPage" stopProcessing="true">
						<match url="^(.*)$" />
							<conditions logicalGrouping="MatchAll">
								<add input="{HTTP_HOST}" pattern="^(.*)$" />
								<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
								<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
							</conditions>
						<action type="Rewrite" url="index.php/{R:1}" />
					</rule>
				</rules>
		  </rewrite>
    </system.webServer>
</configuration>

猜你喜欢

转载自blog.csdn.net/lxy_hegh/article/details/88426100