我在Codeigniter中的控制器文件赞:
Folder1
UserController
LoginController
SignupControler
Folder2
AccessController
BottomController
现在,我想访问控制器,如:
http://example.com/folder1/usercontroller
http://example.com/folder2/bottomcontroller
如何路由 URI 这样,上面的事情可以完成?
答案 0 :(得分:0)
您需要将此添加到.htaccess文件
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css|docs|js|system)
RewriteRule ^(.*)$ index.php?/$1 [L]
这将删除.php