2017-02-12 85 views
1

我正在使用CodeIgniter 3.1.1。CodeIgniter不在子目錄中工作

問題是當我瀏覽子目錄(http://www.wap.com/demosite)CodeIgniter安裝,它總是重定向到主域,我認爲問題是在.htaccess

例如:

域:http://www.wap.com

主要網站目錄public_html/

而且.htaccess文件在主目錄public_html/.htaccess

RewriteEngine on 
RewriteOptions inherit 

ErrorDocument 500 /errors/404 
ErrorDocument 401 /errors/404 
ErrorDocument 403 /errors/404 
ErrorDocument 404 /errors/404 


RewriteCond %{HTTP_REFERER} !^http://wap.com/.*$  [NC] 
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|js)$ - [F,NC] 

CodeIgniter的安裝目錄

public_html/demosite/ 

而且.htaccess文件分目錄public_html/demosite/.htaccess

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

回答

0

我猜想,此舉是一個新增加的?

需要確保在應用程序/配置/ config.php文件,你的BASE_URL設置爲http://www.wap.com/demositehttp://www.wap.com

這常常被漏診,並導致這些類型的重定向

你笨htaccess的還應該被設置爲RewriteBase /demosite/

+0

我試過這個但不工作。 – hime