If you get the error message “Internal Server error” on your website you probably have some component on it that is interfering with the upload of the web server.
How does the error occur?
A common reason for this error to occur is because the page has been moved from our old platform with Apache 2.2 to the new platform with Apache 2.4.
This is a necessary move when Apache 2.2 reaches End of Life which it did in the summer of 2017.
What causes the error and how do you solve it?
The most common reason is that you have some rows in your .htaccess file that is incompatible with Apache 2.4. The reason is usually that you have a plugin such as “All in One WP Security” and “Firewall” or “W3 Total Cache” that has added rows to the .htaccess file for various reasons (f.ex to secure or speed up the page).
The quickest way to solve this issue is by logging in to your FTP and to edit the .htaccess file.
Either you delete all the lines in the file besides these:
- # 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
Save it and upload the file again.
Advanced suggestions for solutions:
If you want to keep the other rows in .htaccess but still solve this issue we have some tips:
The “All in One WP-Security” and “Firewall” plugin has a built-in firewall called 5G and/or 6G Firewall.
This adds rows to .htaccess which unfortunately is not supported by Apache 2.4.
Then changes has to be made for the following:
- # SetEnvIfNoCase User-Agent ^$ keep_out
- SetEnvIfNoCase User-Agent (binlar|casper|cmsworldmap|comodo|diavol|dotbot|feedfinder|flicky|ia_archiver|jakarta|kmccrew|nutch|planetwork|purebot|pycurl|skygrid|sucker|turnit|vikspider|zmeu) keep_out
- Require all granted
- Require not env keep_out
- Order Allow,Deny
- Allow from all
- Deny from env=keep_out
Those need to be changed to:
- # 5G:[USER AGENTS]
- SetEnvIfNoCase User-Agent ([a-z0-9]{2000,}) bad_bot
- SetEnvIfNoCase User-Agent (archive.org|binlar|casper|checkpriv|choppy|clshttp|cmsworld|diavol|dotbot|extract|feedfinder|flicky|g00g1e|harvest|heritrix|httrack|kmccrew|loader|miner|nikto|nutch|planetwork|postrank|purebot|pycurl|python|seekerspider|siclab|skygrid|sqlmap|sucker|turnit|vikspider|winhttp|xxxyy|youda|zmeu|zune) bad_bot
- # Apache < 2.3
- Order Allow,Deny
- Allow from all
- Deny from env=bad_bot
- # Apache >= 2.3
- Require all Granted
- Require not env bad_bot
Save and upload the file.
If your website has “W3 Total Cache“:
Open your .htaccess file as above and delete all rows added by W3.
If the page can be logged in to again log in to the admin panel and uninstall W3. Then reinstall it and re-enable the settings you want.
The plugin will now recognize your server version and insert correct rows in your .htaccess.
If your page has “WP Fastest Cache” and gets this error:
Probably it is because you have activated “Gzip“. See this guide for solution.