安装后,站点显示500内部错误

时间:2018-06-19 09:56:42

标签: php .htaccess

我在我的1and1网络服务器上安装了一个php脚本,但它显示了一个500内部服务器错误,但是当该URL包含index.php时,它会加载正常的index.php主页。 该网址为http://my.gsix.com.ng/但是当它以http://my.gsix.com.ng/index.php方式输入时,它会加载正常的主页。

我还发现,当我第一次在Web服务器之前将其安装到我的localhost时,它的加载效果很好。

编辑:

我的.htaccess文件

RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt) 
RewriteCond %(REQUEST_FILENAME) !-f 
RewriteCond %(REQUEST_FILENAME) !-d 
RewriteRule ^(.*)$ index.php?/$1 [L]

2 个答案:

答案 0 :(得分:1)

这意味着php脚本包含一些错误,请在脚本

之上尝试
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

它会显示您需要修复的错误。

您可以尝试删除.htaccess(它可能会重定向到不存在的页面)

答案 1 :(得分:0)

您需要添加.htaccess文件

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.+$ /index.php [L]

解释:

这启用了重写引擎:

RewriteEngine on

检查现有文件夹(-d)和文件(-f):

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

这实际上是重定向:

RewriteRule . index.php [L]

这会将每个查询重定向到根目录的index.php

相关问题