---
title: "How to Reset .Htaccess File"
description: "Knowing how to reset .htaccess files on your server can save you lots of time. An .htaccess file is a configuration file Apache servers use to configure page loading and redirects. WordPress requires..."
url: https://www.inmotionhosting.com/support/edu/wordpress/reset-the-htaccess-file-to-troubleshoot-wordpress-php-errors/
date: 2020-05-14
modified: 2021-10-08
author: "InMotion Hosting Contributor"
categories: ["WordPress Tutorials"]
type: post
lang: en
---

# How to Reset .Htaccess File

![how to reset htaccess file title image](https://www.inmotionhosting.com/support/wp-content/uploads/2021/08/howtoresethtaccessfile-1024x538.png)

Knowing how to reset `.htaccess` files on your server can save you lots of time. An `.htaccess` file is a configuration file Apache servers use to configure page loading and redirects. WordPress requires a specially configured `.htaccess` file to run, but many themes and plugins will edit the WordPress `.htaccess` file and may conflict with each other. The easiest way to resolve the situation is to reset the file and troubleshoot from there.

- [Why Reset .Htaccess](#why)
- [How to Deactivate an .Htaccess File](#deactivate)
- [The Default .Htaccess Code](#default)
- [How to Reset .Htaccess File Manually](#manual)
- [How to Fix .Htaccess File](#fix)
- [How to Restore .Htaccess File](#restore)
- [What if The .Htaccess File Is Not the Problem](#other)

## Why Reset .Htaccess

Why would you bother resetting your WordPress `.htaccess` file? Let's illustrate the reason with an example scenario — while installing a theme or plugin on your WordPress site, you encounter a confusing error message. According to the error, your PHP version is out of date. When you check your PHP version in [cPanel's MultiPHP Manager](https://www.inmotionhosting.com/support/website/how-to-change-the-php-version-your-account-uses/), it looks like you're using the latest available! This sort of issue is just the kind of problem caused by a coding error in the site's `.htaccess` file. Let's take a look at how to resolve this WordPress PHP error.

**Note**: While some people simply type `htaccess` when discussing the file, the file is more properly called the `.htaccess` file. 'Dot' files are, by default, hidden from view, but visible after you adjust certain settings. The 'dot' is necessary for the file to work properly — the server won't recognize the file without it!

## How to Deactivate an .Htaccess File

Keep in mind that, removing or deactivating the WordPress `.htaccess` file will briefly cause your site to go down. Setting your `.htaccess` back to the default can affect some plugins. If able, you may want to [restrict access to your site](https://www.inmotionhosting.com/support/website/using-the-ip-deny-manager/) while you troubleshoot. With that out of the way, let's head to cPanel's File Manager and deactivate that troublesome `.htaccess` file.

1. [Login to cPanel](https://www.inmotionhosting.com/support/edu/cpanel/how-to-log-into-cpanel/).
2. Go to **File Manager** in cPanel.![cPanel File Manager Icon](https://www.inmotionhosting.com/support/wp-content/uploads/2020/05/01fileManagerIcon.png)
3. Go to the directory containing the WordPress site you are troubleshooting.
4. Find the `.htaccess` file. If you can't see the `.htaccess` file, be sure that [you are able to view hidden files](https://www.inmotionhosting.com/support/edu/cpanel/show-hidden-files-in-file-manager/). ![Sample WordPress Directory with .htaccess file highlighted](https://www.inmotionhosting.com/support/wp-content/uploads/2020/05/02aWordPressDirectoryWithHtaccessHighlighted.png)
5. We aren't going to delete the file— instead we will rename it. That way you will still have it for reference if you need to reconfigure a plugin or theme! Right-click on the file and select **Rename**.![Right Click Menu in File Manager to Rename](https://www.inmotionhosting.com/support/wp-content/uploads/2020/05/03rightClickRename.png)
6. You can deactivate the file by simply adding an extension that cPanel won't recognize to the end. `.bak` is a popular choice in cPanel and Apache since it reminds the user that the file is a backup. I'd also suggest adding the current date to the end of your renamed file. This makes things much easier if you ever have to go through the files later. You'll have a hard time remembering the difference between `.htaccess1.bak` and `.htaccess2.bak`, but will easily be able to tell `.htaccess03042019.bak` and `.htaccess09082019.bak` apart!![renamed .htaccess file](https://www.inmotionhosting.com/support/wp-content/uploads/2020/05/04renamedHtaccessFile.png)

With the `.htaccess` file deactivated, you can [reset the file manually](#manual) or [troubleshoot the problem file](#fix).

For tips on using the File Manager for a variety of tasks, take a look at our [guide to using File Manager in cPanel](https://www.inmotionhosting.com/support/edu/cpanel/using-file-manager-in-cpanel/)!

## The Default .Htaccess Code

This is the default content in a WordPress `.htaccess` file. We'll be referring to it in the tips below, so be sure to copy it whenever you need to overwrite or fill-in a new file.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ -
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php

# END WordPress

## How to Reset .Htaccess File Manually

Since you've already deactivated the old WordPress `.htaccess` file, you can use File Manager to create a new file named `.htaccess`. Simply edit this newly created file, paste in the default code from above, and you've now regenerated your `.htaccess` file. When you do this, you should be able to access your WordPress site, but any custom plugins that edit the `.htaccess` file to work will not be working. Don't worry, we'll cover how to fix this below.

## How to Fix .Htaccess File

If you were trying to update WordPress or a plugin, you should be able to do so now. Once everything is up to date, you'll probably want to deactivate and reactivate your plugins one by one. Many plugins add code to the `.htaccess` file as part of their installation— reactivating the plugins should put any necessary code back in the `.htaccess` file. Do this one at a time so that you'll be able to tell if one plugin in particular causes an error.

For simpler sites, plugin reactivation should be more than enough. If you're using plugins that put a great deal of custom code in the `.htaccess` file, you may need to open the old version of the `.htaccess` in cPanel's file manager and copy the relevant code over to your new `.htaccess`.

If you went through all of those steps, only for the problem to repeat itself, you need to narrow down what plugin or plugins causes the issue. As you reactivate plugins, only reactivate one at a time. Wait a bit between each one and see if a certain plugin causes your site to experience the same problem you were originally troubleshooting.

Is this a bit of a pain? Yes, definitely! But, it's the simplest and most direct way to figure out what the problem plugin is. Once you narrow it down, you can decide if you want to replace the plugin, update the plugin, simply deactivate it, or reach out to the plugin developer for further troubleshooting.

## How to Restore .Htaccess File

If you ever need to restore an old version of the WordPress `.htaccess` file that you saved, simply deactivate the current `.htaccess` file, and rename the old, archived file back to `.htaccess`.

## What if The .Htaccess File Is Not the Problem

If setting your WordPress site's `.htaccess` to a default file did not resolve the issue, you will need to check some other files. Try [troubleshooting your site's php.ini file](https://www.inmotionhosting.com/support/edu/cpanel/what-is-your-default-php-ini-file/) and the [wp-config.php file](https://www.inmotionhosting.com/support/edu/wordpress/wordpress-troubleshooting/). These files can also contain code that overrides your PHP settings. As always, make backup copies of each before you delete anything!
