[英]Url Rewrite issue in codeigniter and IIS 8.5
這是我的web.config文件。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<rewrite>
<rules>
<clear />
<rule name="Rewrite to index.php" enabled="true">
<match url="index.php|robots.txt|images|test.php" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="None" />
</rule>
<rule name="Rewrite CI Index" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" ignoreCase="true" negate="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{REQUEST_URI}" pattern="bnrmcrz" />
<add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" logRewrittenUrl="false" />
</rule>
</rules>
</rewrite>
<httpRedirect enabled="false" destination="" />
</system.webServer>
</configuration>
我需要一種使URL大小寫不敏感的方法,並擺脫它的index.php。
當我輸入“ localhost / testProj ”時,它可以正常工作。 下次我嘗試輸入“ localhost / TESTproj ”。 它顯示找不到頁面。 我真正想要的是,無論提供文件夾名稱的方式如何,如果拼寫相同,它應該將我重定向到同一文件夾。
請幫我解決這個問題。
謝謝
作為您的帖子,我可以猜測您的控制器名稱為testProj
。 因此,當您嘗試訪問TESTproj
該控制器不存在。 因此Codeigniter通過404 Error
。
所以,如果你想訪問TESTproj
在定義這個routes.php
文件。
$route['TESTproj'] = 'testProj';
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.