我无法从iis服务器中的codeigniter中的URL中删除index.php [英] i can not remove index.php from url in codeigniter in iis server

查看:70
本文介绍了我无法从iis服务器中的codeigniter中的URL中删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从IIS中的URL中删除index.php。这是我的.htaccess文件;

I can not remove the index.php from url in IIS. Here my .htaccess file;

RewriteEngine on

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

我也尝试了codeigniter的步骤链接,但它不适用于我的服务器。它说仅适用于apache服务器。但即时通讯使用IIS服务器。甚至我启用了重写模块,但都无法再次使用。

also i tried the steps from codeigniter link but it didn't work for my server. it says only for apache servers. but im using iis server. even i enabled rewrite module but it didnt work again.

推荐答案

您应该将此文件包含在您的 Web中。 config 位于项目的根目录:

You should include this in your Web.config which is located in the root of your project:

<rule name="Remove index" stopProcessing="true">
  <match url=".*" />
  <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  </conditions>
  <action type="Rewrite" url="index.php" />
</rule>

这篇关于我无法从iis服务器中的codeigniter中的URL中删除index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆