在我的代码中实现资产后,我的路由停止工作..
所以我唯一做的就是改变我的.htaccess,我添加“| assets |”,这足以“打破”我和其他项目中的路线..我不能删除这个项目并开始新的
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 :(得分:0)
我建议CodeIgniter的以下.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>