本文介紹了Laravel .htaccess 重寫規則轉換為 IIS的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
Laravel4 框架帶有一個默認的 .htaccess 規則來創建漂亮的 url.
Laravel4 framework comes with a default .htaccess rule for create pretty urls.
規則是這樣的.
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
問題:哪個在 IIS 中等效??
Question: Which is the equivalent in IIS ??
推薦答案
您可以使用 導入Apache 規則功能 將Apache 規則轉換為IIS.
You can use the import Apache rules feature to convert Apache rule to IIS.
在你的情況下,它會變成:
In your case, it will go as:
或者在 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>
這篇關于Laravel .htaccess 重寫規則轉換為 IIS的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!