【发布时间】:2012-11-14 16:35:30
【问题描述】:
我在 CodeIgniter 中遇到了路由问题。
我可以使用http://localhost/MySite 访问我的默认控制器(登录页面)。所以我觉得路由配置不错。
当我提交登录页面的登录表单时,我收到 Not found 错误 404 并且显示的 URL 是 http://localhost/MySite/login?
当我在 url 中插入“index.php”(http://localhost/MySite/index.php/login) 时,它可以工作。在文档中写到我必须在.htaccess 中添加一些行:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
这个 URL 路由有什么问题?
【问题讨论】:
-
application/config/config.php中的$config['index_page'] = '';有没有填空 -
我在
application/config/config.php中有$config['index_page'] = '';。
标签: codeigniter url routing