我希望我的网址是:http://localhost:8080/courses/rd-sharma-solutions/class-12/chapter-3-binary-operations/exercise-3-1
这是我的 routes.php 文件
$route['default_controller'] = 'Admin';
$route['404_override'] = '';
$route['translate_uri_dashes'] = TRUE;
$route['index'] = 'Content/index';
这是我的 .htaccess 文件,位于 project-> application->。htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|assets|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php/$1 [L,QSA]
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
我需要有关URI路由的帮助,并希望缩短URL,还希望删除文件夹名称。
答案 0 :(得分:0)
尝试这个
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]