【发布时间】:2017-02-21 12:41:51
【问题描述】:
我的网站文件夹结构如下...
Application Root
|- administration
|--|- application
|--|- system
|--|- index.php
|--|- web.config
|
|- application
|- system
|- index.php
|- web.config
这里安装了两个CI 框架。
- 网站根目录
- 管理文件夹
这里我说的是administration 子文件夹。
我的 web.config URL Rewrite 如下所示。
<rules>
<rule name="Rewrite to index.php">
<match url="index.php|robots.txt|images|test.php" />
<action type="None" />
</rule>
<rule name="Rewrite CI Index">
<match url=".*" />
<conditions>
<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}" />
</rule>
</rules>
问题是,如果我从site_root/administration/application/config/config.php 的$config['index_page'] 中删除index.php,任何控制器功能都会显示404 page not found。站点根web.config 确实在这样做。
我想从子目录中的 URL 中删除 index.php。
1.我如何通过web.config 执行它?
2。我如何通过.htaccess 执行它?
我找到了THIS,但没有得到答复。
【问题讨论】:
-
好的,你正在运行什么服务器。一个 linux apache 服务器或其他类型的... :)
-
@TimBrownlaw 感谢您的回复。目前我正在使用 IIS 服务器(这就是我的代码 sn-p 显示
web.config文件的原因。)但我也必须在 Linux 服务器中应用它。 -
当您访问管理应用程序时,您会使用像 /admin 这样的 url 吗?也就是说,它必须与主应用程序中使用的任何东西不同。
标签: apache codeigniter mod-rewrite iis web-config