2013-10-18 83 views
0

我正在使用codeigniter php框架。我正在嘗試訪問public_html下的文件夾,但我無法實現。它通過codeigniter顯示404自定義頁面。 .htaccess中的以下腳本與它有關係嗎?htaccess文件配置錯誤

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

感謝

回答

2

它可能是,你可以嘗試添加或者一些條件:

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|js|images|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

或包含文件夾作爲排除的一部分(例如,您的文件夾是「FOOBAR」) :

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

優秀的就業隊友。讚賞 – spacemonkey