donglian1384 2013-02-22 06:55
浏览 164
已采纳

Laravel .htaccess重写规则转换为IIS

Laravel4 framework comes with a default .htaccess rule for create pretty urls.

The rule is this.

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Question: Which is the equivalent in IIS ??

  • 写回答

3条回答 默认 最新

  • duanmei4362 2013-02-22 15:34
    关注

    You can use the import Apache rules feature to convert Apache rule to IIS.

    In your case, it will go as:

    import

    Or in the web.config file:

    <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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?