Internal Server Error in WordPress

If your WordPress site is showing an “Internal Server Error” (HTTP 500), something on your site is preventing the web server from completing the request. The good news is that the cause is usually well known and easy to fix – most often it’s a few lines in your .htaccess file that are no longer compatible with the current version of Apache. This guide explains what happens and how to put it right.

How does the error occur?

A common reason is that the site was migrated from our old hosting platform (Apache 2.2) to the new platform (Apache 2.4). This migration was necessary because Apache 2.2 reached end of life in the summer of 2017. A few of the older Apache 2.2 directives that some plugins (add-ons) write to .htaccess are not understood by Apache 2.4, and that mismatch produces the 500 error.

What causes the error and how is it solved?

The most common cause is one or more lines in your .htaccess file that are incompatible with Apache 2.4. These are usually added by security or caching plugins such as All In One WP Security & Firewall or W3 Total Cache.

The quickest fix is to edit .htaccess via FTP.

  1. Connect to your hosting with an FTP client and open the public_html folder.
  2. Download the .htaccess file to your computer. Keep the original as a backup.
  3. Open the file in a plain text editor and replace its contents with the standard WordPress .htaccess rules shown below, then save and upload it back to public_html, overwriting the original.

Default WordPress .htaccess rules

Reload the site – the 500 error should be gone.

Advanced solutions – keeping plugin-specific rules

If you want to keep the other rules in .htaccess but still resolve the issue, the following tips target the two most common culprits.

All In One WP Security & Firewall

The All In One WP Security & Firewall plugin has a built-in firewall called 5G and/or 6G Firewall that adds rules to .htaccess which are not supported by Apache 2.4.

Replace this block:

Old 5G/6G firewall rules incompatible with Apache 2.4

With this block:

Updated firewall rules compatible with Apache 2.4

Save and upload the file.

W3 Total Cache

If your site uses W3 Total Cache:

  1. Open .htaccess via FTP as above and delete every line that was added by W3 Total Cache (the plugin marks its blocks with comments).
  2. If you can now log in to your WordPress dashboard, go to Plugins, deactivate and uninstall W3 Total Cache, then reinstall it and re-enable the settings you want.

The plugin will detect your Apache version when it reinstalls and write the correct rules into .htaccess.

Was this article helpful?

Related Articles