WordPress网站定制开发专家
WordPress企业主题特惠

赞一个 2041

WordPress 出现 500 Internal Server Error的情况并不多见,所有,一旦有用户遇到此类情况也很难找到具体的解决方法,这种情况在国外主机中出现的频率尤其高,主要是国外主机给用户的权限都很高,很多文件都是自动写入到对应的配置文件,使得用户无法及时发现问题原因。WPYOU 在为客户处理相关问题时,总结找到的解决方法如下:

WordPress出现500 Internal Server Error的情况一般表现为,访问主域名 http://www.yourdomain.com时会出现错误提示Internal Server Error,内容如下:

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

Please contact the server administrator, cpanel@hosting.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.

首先,查看网站根目录下的 .htacess,因为很多设置都会自动写入一些函数到这个文件,尤其在主机迁移时,.htacess 是在原主机环境下生成的,如果迁移后的主机有的函数不支持的话,就有可能导致500错误。解决方法就是手工把 .htacess里的无关函数删除。WordPress 程序对应的  .htacess 文件内容只有以下这些:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

其他的代码理论上是都可以删除的。

处理好 .htacess 文件后,再重新访问网站试试就可以正常访问了。

上一篇:

下一篇:

在线评论

2 个评论

分页
在线客服
在线客服关闭
WPYOU官方微信

扫码关注官方微信