【问题标题】:website name is currently unable to handle this request. HTTP ERROR 500 in codeigniter网站名称目前无法处理此请求。 codeigniter 中的 HTTP 错误 500
【发布时间】:2017-12-31 02:09:16
【问题描述】:
RewriteEngine On
RewriteEngine On 
<IfModule mod_rewrite.c>
 RewriteEngine On

 #RewriteCond %{HTTPS} off
 #RewriteCond www.%{HTTP_HOST} ^(?:www\.)?(www\..+)$ [NC]
 #RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

这是 .htaccess 文件 我的配置文件是这样的

  $config['base_url'] = 'http://website.org/';
  $config['index_page'] = '';

这在测试服务器上运行完美,但在实时服务器上出现 500 错误。

【问题讨论】:

  • 只使用一次RewriteEngine On
  • 试试this,检查.htaccessdbconfig文件
  • 在出现 500 内部服务器错误时,您始终要做的第一件事就是检查相关的日志文件。 (-1 仍然需要向“软件工程师”解释。)
  • 感谢您的评论,但我在使用所有选项后提出了这个问题,错误记录了错误模式,它没有显示任何内容。
  • 请求没有进入我的主控制器的结构。

标签: php .htaccess codeigniter


【解决方案1】:

codeigniter 中检查.htaccess 的下面提到的代码。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
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

#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|(.*)\.swf|images|robots\.txt|css|js|docs|cache)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

如果仍有 500 错误,请告诉我。

【讨论】:

    【解决方案2】:

    您需要在您的 .htaccess 文件中添加以下代码。

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php?/$1 [PT,L]
    </IfModule>
    php_value upload_max_filesize 100M
    php_value post_max_size 100M
    

    在此之前,您需要检查 Mod.rewrite 是否已在您的实时服务器中启用,如果没有,则您需要从

    Php.ini -> ;mod_rewrite 从 php.ini 文件中删除 (;)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-22
      • 1970-01-01
      • 1970-01-01
      • 2018-11-21
      • 1970-01-01
      • 1970-01-01
      • 2017-10-21
      相关资源
      最近更新 更多