codeigniter和IIS 8.5中的Url重写问题


Url Rewrite issue in codeigniter and IIS 8.5

这是我的网页。文件配置

    <?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';