教程 - 创建新闻项目。提交新文章后获得404

时间:2012-09-27 19:25:51

标签: php codeigniter

了解代码点火器,并遵循本教程的这一特定部分:

http://codeigniter.com/user_guide/tutorial/create_news_items.html

一切正常,直到我点击“创建新闻项目”。我收到 404 页面,我的网址栏如下所示:

http://localhost/tut/index.php/news/localhost/tut/index.php/news/create

想想也许这是路线的错误:

$route['default_controller'] = "news/index";
$route['404_override'] = '';
$route['news/(:any)'] = 'news/view/$1';
$route['news'] = 'news'; // what's this for?
$route['news/create'] = 'news/create';

另外,我的config.php:

$config['base_url'] = 'localhost/tut';

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

根据this thead,您的base_url设置不正确。请按照主题遵循建议。