在子文件夹中安装Codeigniter,忽略URL中的子文件夹部分

时间:2014-11-25 15:08:28

标签: php .htaccess codeigniter bonfire

我希望将我的Codeigniter Bonfire应用程序安装在2个文件夹中,其中一个是" en"另一个是" sl" (两者都有不同的语言和不同的数据库)。

到目前为止,我的第一个或主控制器或它如何调用位于公共目录中:root/sl/public/index.php并声明:

$path = "..";
$bonfire_path = "${path}/bonfire";

我的.htaccess看起来像这样:

RewriteEngine on
RewriteBase /

ReWriteCond %{REQUEST_URI} !public/
ReWriteRule ^(.*)$ public/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* sl/index.php?/$0 [PT,L] 

如果公共目录存在于根文件夹中,但是当我希望它移动到" sl"文件夹和我输入" localhost / sl"在我的URL字段中,我得到:

The requested URL /public/ was not found on this server.

所以我尝试修改我的.htaccess并添加ReWriteRule ^(.*)$ sl/public/$1 [L](注意" sl /"部分),现在我得到:

404 Page Not Found

The page you requested was not found.

如果我在URL字段中输入页面名称,我希望一切正常,我也希望以应用程序忽略/ sl / part in URL的方式编写.htaccess

0 个答案:

没有答案
相关问题