2012-06-02 78 views
0

我已經中/home/domain/public_html/subfolder的.htaccess URL重寫笨不工作

RewriteEngine on 
RewriteBase/
RewriteCond $1 !^(index\.php|user_guide|robots\.txt) 
RewriteRule ^(.*)$ public/index.php?/$1 [L] 

以下.htaccess但這不起作用http://domain.com/subfolder/

文件不存在:/home/domian/public_html/public

我顯然有我的重寫規則搞砸了。整個CI應用程序位於Web根目錄的子文件夾中。

/home/domain/public_html/subfolder 
[[email protected] subfolder]$ ls 
application license.txt public system user_guide 

and index.php is public。

回答

0

首先,你的index.php應該和應用程序和系統在同一個目錄下。

一旦你移動了它,在你的.htaccess試試這個

RewriteEngine on 
RewriteBase /subfolder/ 
RewriteCond $1 !^(index\.php|user_guide|robots\.txt) 
RewriteRule ^(.*)$ index.php?/$1 [L] 

同樣在一個不相關的說明,我會刪除用戶導向目錄,因爲它包含的一切是在訪問。