【问题标题】:Getting error in codeigniter : a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request在 codeigniter 中出现错误:尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误
【发布时间】:2016-08-26 08:18:30
【问题描述】:

之前我的菜单运行良好,但突然开始出错

未找到 在此服务器上未找到请求的 URL /allbound/index.php。 此外,在尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误。

我该如何解决这个问题?

【问题讨论】:

标签: php codeigniter


【解决方案1】:

您必须编辑访问网址。

在这种情况下,访问这样的网址http://dograpublicschool.com/?ndex.php/confluent/travelling/flightsd。它正在和我一起工作。

删除 codeigniter 中的 index.php

您可以通过编辑.htaccess 来删除 index.php,如下所示

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

希望对您有所帮助。谢谢

【讨论】:

    【解决方案2】:

    //在函数名前添加index.php

    dograpublicschool.com/confluent/travelling/index.php/flights‌​d

    从 url 中删除 index.php

    试试

    CodeIgniter removing index.php from url

    【讨论】:

      【解决方案3】:

      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php/$1 [L]
      </IfModule>

      【讨论】:

      • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-27
      • 2012-09-27
      • 2017-10-19
      • 2017-08-27
      • 2016-08-07
      • 2017-09-03
      相关资源
      最近更新 更多