Codeigniter网站无法在实时服务器中运行

问题描述 投票:1回答:2

有人能帮我吗,

我的网站在登台服务器上工作正常,我移动了网站实时服务器,我收到了HTTP ERROR 500。

我的htaccess文件是

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

两台服务器都有相同的htaccess文件。 mod_rewrite已启用,从服务器端一切正常。有人可以帮我解决问题所在

.htaccess codeigniter http
2个回答
0
投票

不完全是一个答案,但对于评论来说太大了:

switch (ENVIRONMENT) {
    case 'development':
        error_reporting(~E_DEPRECATED);
        ini_set('display_errors', 1);
        break;
    case 'testing':
    case 'production':
        error_reporting(~E_DEPRECATED);
        ini_set('display_errors', 1);
        break;
    default:
        header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
        echo 'The application environment is not set correctly.';
        exit(1); // EXIT_ERROR
}

production更改为与development具有相同的error_reporting,这样您将获得错误而不是查看通用500页。

我不相信你.htaccess文件在这里有问题,因为你会得到400而不是500(内部服务器错误)。


0
投票
you can try this:

upload htaccess file in root

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /
    Options -Indexes


    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>

        <IfModule !mod_rewrite.c>

    ErrorDocument 404 /index.php

</IfModule>
© www.soinside.com 2019 - 2024. All rights reserved.