Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel .htaccess rewrite rule conversion to 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 ??

like image 781
Javier Cadiz Avatar asked Feb 22 '13 06:02

Javier Cadiz


1 Answers

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>
like image 181
cheesemacfly Avatar answered Sep 29 '22 17:09

cheesemacfly