这一定是个老问题了。但是一直尝试通过堆栈溢出和 CI 论坛。无法找到解决方案。
我的 CI 布局是这样的。(在 localhost 中)
-万维网
- folder1 - folder2 - system (folder) - frontend (has all the contents of application folder) - controllers - users (folder) - account.php - models - views - users (folder) - accountdata.php - ... - ... - ... - backend (has all the contents of application folder) - controllers - users (folder) - account.php - models - views - users (folder) - allusersdata.php - ... - ... - ... - frontend.php (same as index.php but changed $application_folder = 'frontend';) - backend.php (same as index.php but changed $application_folder = 'backend';) - .htaccess - (index.php file removed)
目的
I Can easily access the site :
http://localhost/folder1/folder2/frontend.php/users/account
And access the admin panel like :
http://localhost/folder1/folder2/backend.php/users/account
I just want to access the site like :
http://localhost/folder1/folder2/users/account
And access the admin panel like :
http://localhost/folder1/folder2/manage/users/account
所以问题是我的 .htacces 文件的内容是什么?
我尝试了这个(以及更多的东西)但是通过这种方式前端工作但后端方式不工作:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Backend
RewriteRule ^manage$ backend.php [L]
RewriteRule ^manage/(.*)$ /folder1/folder2/backend.php/$1 [L]
# Not a valid filename? Frontend
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /folder1/folder2/frontend.php/$1 [L]
</IfModule>