2017-07-25 138 views
0
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> 

这HTTP错误500是.htaccess文件 和我的配置文件是这样的网站名称目前无法处理此请求。在笨

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

这是工作完美公测服务器上,但让现场服务器的500错误。

+0

什么只有一次使用行'RewriteEngine On' –

+0

尝试[this](https://stackoverflow.com/questions/45125796/internal-server-error-in-codeigniter-on-live-主机/ 45125858#45125858),检查'.htaccess','db'和'config'文件 – Regolith

+0

你总是在500内部Se rver错误,是你去检查相关的日志文件。 (-1仍然必须向“软件工程师”解释) – CBroe

回答

0

检查下面提到的代码.htaccesscodeigniter

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

0

您需要将下面的代码添加到您的.htaccess文件中。从PHP; mod_rewrite的删除(;)> -

<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中启用.ini文件

相关问题