• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

解决Additionally, a 500 Internal Server Error error was encountered while trying错误

武飞扬头像
Luke
帮助16754

前言

打开网站,页面提示Additionally, a 500 Internal Server Error error was encountered while trying,困扰了我一上午,网上查询了一编,都没找到一个合理的解决方法,现在解决了,我将方      法发表在我的博客,供大家讨论

完整的错误提示是

        Internal Server Error

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

        Please contact the server administrator, wuliqiang_aa@163.com and inform them of the time the error occurred, and anything you might have done that may have caused the         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.

 

原因

出现这个的原因是因为我要设置.htaccess文件,要重写URL,同时要配置404 500错误页面,使用

ErrorDocument 404 /html/404.html
ErrorDocument 500 /html/500.html

进行配置,配置好后发现网站打不开,出现500错误。

解决方法如下

        在.htaccess文件里面的写法

        原:错误配置

Options  FollowSymlinks -Multiviews
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ website/$1 [QSA,PT,L]

        新:正确配置

Options  FollowSymlinks -Multiviews
RewriteEngine on
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ website/$1 [QSA,PT,L]

原因:在.htaccess文件的Rewrite的规则里面新加两段话

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]  

加上这两句话后则解决问题。

结论

出现 Additionally, a 500 Internal Server Error error was encountered while trying 的具体原因是因为:重写重定向限制

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanecgc
系列文章
更多 icon
同类精品
更多 icon
继续加载