这一定是个老问题。但是一直尝试通过堆栈溢出和CI论坛。 无法找到解决方案。
我的CI布局是这样的。(在localhost中)
-www
- 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>