快捷搜索:   文件 java linux

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


一、打开网站,页面提示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]  加上这两句话后则解决问题



具体原因:重写重定向限制

 

 

 



您可能还会对下面的文章感兴趣:

头像:

设置头像

x
名称(*):
域名    :
邮箱    :

评论内容(*): 刷新评论 提交评论