【发布时间】:2014-08-27 19:53:21
【问题描述】:
我的网站的根文件夹包含现有网站。我开发了一个基于 codeigniter 的管理系统,我希望将它发布在 /editor 文件夹中,但是我所做的所有 mod_rewriting 似乎都是徒劳的,因为如果有任何重写,它就无法访问输入字符串或 index.php 文件出现。这是结构:
/
/editor
index.php
.htaccess
index.php
.htaccess
这是我当前位于站点根目录的 .htaccess 文件:
DirectoryIndex index.php
RewriteEngine On
RewriteRule %{REQUEST_URI}^/?editor/(.*)$ (.*)/editor/$1 [R,L]
RewriteCond $1 ^$
RewriteRule ^(.*)$ ?p=homepage [L]
RewriteCond $1 !^(index\.php|editor|css|pdf|eshot|js|fonts|images)
RewriteRule ^(.*)$ index.php/?p=$1 [L]
编辑
当您导航到 /editor 子文件夹时,当前规则显示根 index.php 文件,而它应该显示 /editor 文件夹中的 index.php 文件。
重新编辑
可能是 /editor 子文件夹中的 .htaccess 文件,代码如下:
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|lib|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
【问题讨论】:
标签: php apache .htaccess codeigniter mod-rewrite