如何清除codeigniter在Windows Server和IIS上的index.php? [英] How to remove index.php in codeigniter on Windows Server and IIS?
问题描述
如何在Windows Server和IIS上的codeigniter中删除index.php?
How to remove index.php in codeigniter on Windows Server and IIS?
我在搜索answer时发现了这一点
I found this when i search for answer
但是当我尝试我的CI仍然需要索引.php要运行
,web.config文件必须添加,并且在编辑我的web.config之前还有其他步骤吗?
but when i try my CI still need index.php to run whre the web.config file must be add and is there any other step before i edit my web.config?
推荐答案
如果未安装网址重写模块,请从此处安装 http://www.iis .net / downloads / microsoft / url-rewrite
If URL Rewrite module is not installed, please install it from here http://www.iis.net/downloads/microsoft/url-rewrite
请检查完整的web.config文件。
Please check the complete web.config file. Place this in the same folder where the index.php is placed.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
它在Windows服务器2008 R2中的IIS中工作
Its working in IIS in Windows server 2008 R2
这篇关于如何清除codeigniter在Windows Server和IIS上的index.php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!