How to Create a New .htaccess file to Fix WordPress 500 Internal Server Errors

March 23, 2021 / WordPress

A 500 internal server error is an error that stops your website from functioning properly. This is caused by a problem that prevents your server from carrying out a request. Although there are a number of potential causes of 500 internal server errors, one of the most common is a corrupted .htaccess file. This tutorial will explain how to create a new one.

It is important to note, however, that the 500 error code does not identify the exact cause of the error and there may be a different cause, such as a plugin conflict or the PHP memory limit may need to increase.

How does a 500 internal server error affect my website?

If you have a 500 internal server error, your website will not display on a browser. Instead, users will be shown a white screen with the 500 error message. In effect, your website will be offline until the issue is fixed. In the worst-case scenario, this may also prevent you from accessing the WordPress admin login page, requiring you to attempt a fix by accessing the website files via cPanel or FTP.  

What is a .htaccess file?

The .htaccess file is a small but essential file for WordPress websites that controls the configuration of the Apache web server on which your site runs. If it is corrupted, your site will not be able to function properly.

How to create a new .htaccess file

Thankfully, this is not too difficult an issue to fix and you can do this by simply creating a new .htaccess file. To do this:

1. Log into your cPanel account.

2. Navigate to the Files section and click on File Manager.

3. If you have only one domain, the .htaccess file will be in the Home folder. If you have multiple domains, choose the affected domain and you will find its .htaccess file in the top-level folder for that domain.

4. The .htaccess file will be hidden if you can’t see it. To make it visible, click on the Settings button at the top right of the cPanel screen and when the dialog box opens, check the Show Hidden Files (dotfiles) option. The .htaccess file should now be visible in the list of files.

5. Now the .htaccess file has been located, the next step is to rename it. Do not delete it, instead, right-click on the file and rename it to something like .htaccess-old.

6. Now try to view your website in your browser. If your website appears normal and there is no 500 internal server error notification, the issue has been fixed.

7. To complete the task of creating a new .htaccess file, you now need to log in to your website’s WordPress admin panel.

8. When logged in, navigate to Settings > Permalinks.

9. On the Permalinks page, scroll to the bottom and click the Save Settings button. Doing this, without making any changes to the permalink settings, will create a new .htaccess file that works correctly.

Note: A corrupted .htaccess file might not have been the cause of your internal server error. If your website continues to display the 500 internal server error notification, the next steps are to increase the PHP memory limit and, if that doesn’t work, deactivate all your plugins and reactivate them one at a time to see if any are causing the issue.

For more help with your hosting, visit our Knowledgebase.


Spread the love