网站名称目前无法处理此请求。 codeigniter中的HTTP ERROR 500

时间:2017-07-25 08:52:46

标签: php .htaccess codeigniter

Settings --> Parameters --> System Parameters

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

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>

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

2 个答案:

答案 0 :(得分:0)

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

<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错误,请告诉我。

答案 1 :(得分:0)

您需要在.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 - &gt; ; mod_rewrite从php.ini文件中删除(;)