2011-04-03 55 views
0

我有我的CodeIgniter从public_html目录安装一个路径,所以它不在我的web文件夹的根目录。CodeIgniter - 在不同情况下摆脱index.php

有人可以建议.htaccess的代码,将摆脱基于这个URL的index.php?

我已经尝试了一些过去,他们没有工作,我很难过。

干杯,

我曾尝试下面的代码

RewriteEngine On 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
+0

我已经更新了我的问题...谢谢 – BigJobbies 2011-04-03 14:26:59

回答

0

您是否已将index.php文件夹放回到public_html中?

我会建议不要这样做,应该没有损害做index.php公开,但很值得隐藏其余的。

把index.php的后面public_html下,然后修改它,像这样:

第56行:

$system_path = '../system'; 

线72:

$application_folder = '../application'; 

当然,如果你有他们在另一然后相应地更改路径。

编辑:

对不起,我应该请注意,以后你的htaccess应该是这样的:

RewriteEngine on 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 
0

尝试加入

RewriteBase /public_html/

第一RewriteCond上方。

但我不是任何方式的.haccess向导。

0
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php?$1 [L] 
相关问题