.htaccess 网站名称当前无法处理此请求,codeigniter中的HTTP错误500

lawou6xi  于 2022-11-16  发布在  其他
关注(0)|答案(2)|浏览(131)
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错误在现场服务器。

i2loujxw

i2loujxw1#

检查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错误。

eufgjt7s

eufgjt7s2#

您需要在.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。如果未启用,则需要从

药典ini -〉; mod_rewrite以移除(;)从php.ini文件

相关问题