云服务器iis环境 tp5.1伪静态配置
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <defaultDocument> <files> <add value="index.php" /> </files> </defaultDocument> <handlers> <remove name="php" /> <add name="php" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="D:\phpstudy_pro\Extensions\php\php7.0.9nts\php-cgi.exe" resourceType="File" requireAccess="Script" /> </handlers> <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>
注意对应的你php版本路径
scriptProcessor="D:\phpstudy_pro\Extensions\php\php7.0.9nts\php-cgi.exe"
这是新加的伪静态配置 放在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>