1

我在这个论坛上搜索了一整天,发现了和我一样的问题,尝试了所有的答案,但就是不行。

在我的本地主机中,一切都很好,但后来当我决定将它上传到实时网络服务器时,它开始显示

服务器遇到内部错误或配置错误,无法完成您的请求。

请联系服务器管理员 webmaster@reportingsystem.cnnpa.com 并告知他们错误发生的时间,以及您可能所做的任何可能导致错误的事情。

服务器错误日志中可能提供有关此错误的更多信息。

此外,在尝试使用 ErrorDocument 处理请求时遇到 500 Internal Server Error 错误。

在我的错误日志中,我看到了这个:

[Tue Jan 29 22:05:53 2013] [error] [client 112.198.77.50] File does not exist: /home/cnnpa/crs/404.shtml
[Tue Jan 29 22:05:53 2013] [error] [client 112.198.77.50] File does not exist: /home/cnnpa/crs/crimeindex

基于阅读类似问题,我认为这与 .htaccess 和 mod_rewrite 有关。当我删除 .htaccess 时,它似乎可以工作,但我不想要这个解决方案,因为首先我使用 .htaccess 来获得更清晰的 URL(通过删除 index.php)。

这是我当前的 .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /crs/

    #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>

在我的 config.php

$config['base_url'] = 'http://reportingsystem.cnnpa.com/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
4

1 回答 1

3
RewriteBase /crs/

我的第一个嫌疑人将是您的 htaccess 文件中的RewriteBase值。

查看您的 config.php,您似乎正在从 DocumentRoot 提供应用程序。如果是这种情况,则 RewriteBase 应编写如下。

RewriteBase /    
于 2013-01-29T14:48:54.860 回答