How To Edit Your .htaccess File And Make It Default

What is .htaccess File?

The .htaccess file is created on its own when you install WordPress for the first time. It’s an extremely important file that allows you to give specific instructions to the hosting server. The file is used for carrying out functions like redirects, modifying website configuration and even securing your WordPress site.


How to Find the .htaccess File in WordPress?

The .htaccess file is generally hidden. The reason being it’s a very important file and WordPress wants to protect it from any potential danger such as being accidentally deleted.

To find the .htaccess file, you’ll need to log into your WordPress hosting account and navigate to the cPanel. From there, launch the File Manager and then select the public_html folder.

Since the .htaccess file is hidden, you’ll need to make it visible by selecting Setting which is generally located up in the right-hand corner of the cPanel File Manager. As soon as you select Settings, a window pops out. From there, select the option Show Hidden Files.

Now, go back to the public_html folder and the .htaccess will should be visible.


Now that you know how to find the file, let us show you how to edit it.


How to Edit the .htaccess WordPress File?

There is more than one way of editing the .htaccess file. In the next few paragraphs, we are going to show them all.

  1. Edit htaccess WordPress File From cPanel
  2. Edit htaccess WordPress File Using FTP Client
  3. or Edit htaccess WordPress File With a Plugin

1. Editing .htaccess File From cPanel

Step 1:

Log into your hosting account and then navigate to cPanel and select File Manager.

Step 2:

From the File Manager, go to the public_html folder. The .htaccess file is located in this folder. When you find it, right-click and select Edit.

That’s it. Now you can insert snippets of codes to make modifications to your website.

You can add below code into your .htaccess file to make it default again. Below is the default code for WordPress.


# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress


Copy and paste above code into your htaccess file and save.



  • 0 Kasutajad peavad seda kasulikuks
Kas see vastus oli kasulik?

Seotud artiklid

There has been a critical error on this website. Please check your site admin email inbox for instructions.

What’s Causing There has been a critical error on your website. As WordPress said itself ” Since...

How do I use or install LSCache in WordPress?

Support for LSCache is available by default, but the WordPress plugin is not installed by...

Where can I find LiteSpeed cache plugins?

The latest LiteSpeed cache plugins for multiple CMS systems, such as WordPress, Joomla, etc., can...

Update woocommerce product and get error 403

Problem:  When update product or price in Woocommerce, you will get Error 403   Solution: Go...

Elementor Error 403

PROBLEM: Trying to update / save elementor and return Error 403     SOLUTION: Step 1:...