首页 文章

尝试访问网站时出现内部错误

提问于
浏览
0

获得以下错误

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@api.example.com.au to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

我推了直播codeigniter项目,我更新了.htaccess,数据库文件,配置文件 .

.htaccess文件包含以下代码

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|css|js|images|robots\.txt)
RewriteRule ^(.*)$ index.php?$1 [L]
Options -Indexes

Codeigniter项目在 api.websiteName.com 文件夹内,它不在 public_html 中,如果我删除index.php和htccess文件并上传"index.html"文件用于测试目的,那么index.html工作正常,但当我上传index.php和.htaccess文件时,它说内部服务器错误500,同一问题有很多答案,我按照答案并更新.htaccess文件,但没有任何作用 . 文件夹权限设置为755但仍然得到相同的错误 . 任何帮助将非常感激 .

PHP verison高于5.6

1 回答

  • 0

    您可以在代码中尝试此 .htaccess 文件 .

    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    
    RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
    <IfModule mod_headers.c>    
          Header add Access-Control-Allow-Origin "*" 
    </IfModule>
    <IfModule mod_env.c>
        SetEnv CI_ENV development
    </IfModule>
    

    我希望它会帮助你..

相关问题