500内部服务器错误 - GoDaddy flesk服务器

时间:2018-04-16 10:08:03

标签: wordpress .htaccess web-config

我开发了WordPress网站,工作正常。当我将其移至GoDaddy flesk server并尝试create/edit WordPress帖子或页面时 - 它会出现以下错误:

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

Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

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

我的.htaccess文件是:

# 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

web.config文件是:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>  
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

任何帮助将不胜感激。 感谢

2 个答案:

答案 0 :(得分:1)

删除“#END WordPress”之前和之后的额外/空换行符。它应该解决这个问题。

# 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

答案 1 :(得分:1)

最后,我找到了它的解决方案。我刚在<httpErrors errorMode="Detailed" existingResponse="PassThrough"/>文件中添加了web.configGet detailed errors

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <httpErrors errorMode="Detailed" existingResponse="PassThrough"/>
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" existingResponse="PassThrough"/>
    </system.webServer>
</configuration>

它会产生以下致命错误;

Fatal error: Class ‘MPCETemplate’ not found in C:\XXX\XXX\XXX\XXX\wp-content\plugins\motopress-content-editor\includes\ce\Library.php on line 1989

解决方案:实际上,问题出在PHP代码中。 Library.php插件中缺少motopress-content-editor

我刚登录WordPress管理面板并停用此motopress-content-editor插件。它开始工作了。