【发布时间】:2014-08-01 03:45:56
【问题描述】:
我在 CodeIgniter 中遇到 404 错误的问题。我的控制器:
public function show($id = 0)
{
$review = $this->site_reviews->get_review($id);
if ($review)
{
.....
}
else
{
show_404();
}
现在如果我的链接是 blog.com/article/134 一切都很好,但是如果我在链接末尾添加例如 blog.com/article/134?678678sdss 没有错误..我想在链接时显示 404是这样的。
请大家帮帮我
【问题讨论】:
-
在哪里创建 show_404() 函数?
-
@er_Rajendraa
show_404()函数由 CodeIgniter 提供 - 请参阅其 Error Handling。
标签: php codeigniter seo http-status-code-404