【问题标题】:302 Found Document Has Moved with CodeIgniter302 Found Document has Moved with CodeIgniter
【发布时间】:2013-05-17 16:22:19
【问题描述】:

我正在使用 codeIgniter 开发定制的 CMS。它在我的本地主机和 bluehost 的帐户中完美运行。现在我已经将网站上传到 ipage 我收到一个奇怪的错误

0<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://igncms.safaapps.com/admin/login">here</a>.</p>
<p>Additionally, a 302 Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
HTTP/1.1 200 OK
Date: Sat, 18 May 2013 15:08:04 GMT
Content-Type: text/html
Content-Length: 3897
Connection: keep-alive
Server: Apache/2
X-Powered-By: PHP/5.2.17
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache


<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <title>Lazy Admin | Login</title>
        <meta name="description" content=""/>
        <meta name="viewport" content="width=device-width"/>

        <link rel="stylesheet" href="http://igncms.safaapps.com/css/admin/bootstrap.min.css"/>

        <link rel="stylesheet" href="http://igncms.safaapps.com/css/admin/bootstrap-responsive.min.css"/>
        <link rel="stylesheet" href="http://igncms.s

这正是我所看到的,我注意到输出的开头有一个 0。我不知道从哪里开始。

更有趣的是它只发生在某些时候,我还没弄清楚它是什么时候出现的,但它随机出现,然后是某种请求(例如表单提交、重定向等),它只是在页面刷新时消失。

它成为一个主要的头痛 cz 我必须将 30 多个网站上传到 ipage 主机。我不知道从哪里开始解决问题。

注意事项:

网址:http://igncms.safaapps.com/ 我的网址被定向到 /igncms/

cms 文件夹的htaccess -

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

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

codeIgniter 的路由配置

$route['default_controller'] = "home";
$route['admin'] = "admin/dashboard";
$route['404_override'] = '';

注意仪表板控制器 它位于 application/controller/admin/dashboard.php (控制器文件夹中的一个文件夹)有一个路由。

我已经确定问题是由 htaccess 引起的。谁能告诉我正确的 htaccess 声明以从 CI 2.1.2 中隐藏 index.php?

问我,我会提供所有信息。我需要尽快解决这个问题

【问题讨论】:

  • 你找到任何线索了吗?我在 Cakephp 中有类似的问题(登录后立即)。谢谢,
  • 感谢你的兴趣,我没有,但我 100% 确定这是服务器问题,如果你让我知道你什么时候有 fnd 1,那真是太好了,我会做当然一样!

标签: php codeigniter http-status-code-302


【解决方案1】:

更改服务器中的 PHP 版本可能会解决某些问题。我的是 5.6,我换成了 5.5。

【讨论】:

    【解决方案2】:

    我的朋友们,只有在 AVAST ANTIVIRUS 处于活动状态时才会在 Firefox 和 Chrome 中发生!!!检查:http://forge.prestashop.com/browse/PSCFV-9164 并且看起来只在 ipage 托管上

    【讨论】:

    • 您的回答非常具体,但是我在linkedin 中找到了解决方案,因此它已经修复。无论如何感谢您的信息
    【解决方案3】:

    我的问题终于通过下面的设置解决了

    这个是新的-

    /*config.php*/ 
    
    $config['index_page'] = ''; 
    $config['uri_protocol'] = 'REQUEST_URI'; 
    
    
    /*routes.php*/ 
    $route['default_controller'] = "home"; 
    $route[''] = "home/index"; 
    $route['admin'] = "admin/dashboard"; 
    $route['home'] = "home/index"; 
    $route['404_override'] = ''; 
    
    
    
    /*min htaccess*/ 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase / 
    RewriteRule ^index\.php$ - [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /index.php [L] 
    </IfModule>
    

    【讨论】:

      猜你喜欢
      • 2011-09-25
      • 1970-01-01
      • 1970-01-01
      • 2016-09-10
      • 1970-01-01
      • 2012-11-13
      • 1970-01-01
      • 1970-01-01
      • 2012-04-30
      相关资源
      最近更新 更多