【发布时间】:2016-08-20 01:18:21
【问题描述】:
我的 Codeigniter 项目在 localhost 中运行良好(我使用的是 linux Cpanel)
https://localhost/project/profile
但如果链接中没有 index.php,它就无法在线工作
https://domainname.in/index.php/profile
.htaccess 文件
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
还有我的 route.php 文件
$route['default_controller'] = "pages/home";
$route['404_override'] = '';
$route['pages/profile'] = "pages/profile";
$route['creators'] = "pages/userList";
$route['auth/logout'] = "auth/logout";
$route['auth'] = "auth/logout";
$route['auth/login'] = "auth/login";
$route['auth/register'] = "auth/register";
$route['pages/post'] = "pages/post";
$route[$username.'/about'] = "pages/menus/about";
$route[$username.'/credibility'] = "pages/menus/credibility";
$route[$username.'/release'] = "pages/menus/release";
$route[$username.'/jobs'] = "pages/menus/jobs";
$route[$username] = "pages/userList/userview/$1";
【问题讨论】:
标签: .htaccess codeigniter cpanel