2014-03-28 49 views
0

後在我的代碼執行的資產,我的路線停止工作..Codeignite:路由停止工作

所以我做的唯一的事情就是改變我的.htaccess,我加入「|資產|」,它是足夠在這方面和其他項目「打破」我的路。我不能刪除這個項目,並啓動新的

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

路線:

$route['indicacao'] = "indicacao"; 
$route['projeto'] = "projeto"; 
$route['logout'] = "home/logout"; 
$route['login'] = "home/login"; 
$route['default_controller'] = "home"; 
$route['404_override'] = ''; 
+0

什麼是你的'.htaccess'位置 –

回答

0

我建議如下。對於笨htaccess的規則:

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ index.php?/$1 [L] 

RewriteCond %{REQUEST_URI} ^application.* 
RewriteRule ^(.*)$ index.php?/$1 [L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 
  1. 它阻止訪問/系統/應用程序目錄。
  2. 允許訪問所有物理上存在的文件/目錄。
  3. 將所有其餘虛擬路由重定向到配置項。
+0

不錯,但這不解決我的問題,還是不行,我總是配置我的資產,航線停止工作 – TMoraes

+0

嗯不知道你...你確定的名字是正確,你只使用拉丁? – Serg

+0

Portugueses..yeah!這是對的,我所有的路線都在運作,直到我實現資產!這是我做的第二個項目!第一次發生同樣的事情 – TMoraes