Laravel4 框架带有默认的 .htaccess 规则,用于创建漂亮的 url。
规则是这样的。
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
问题:IIS 中哪个是等价物??
最佳答案
您可以使用 import Apache rules feature将 Apache 规则转换为 IIS。
在你的情况下,它将是:
或者在web.config
文件中:
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
关于php - Laravel .htaccess 重写规则转换为 IIS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15018538/