How to Edit .htaccess File in WordPress

Do you want to Edit .htaccess File in your WordPress site? The WordPress htaccess file is the most important file that is located in the root folder of your WordPress installation. Today in this article we will tell you How to Edit .htaccess File in WordPress.

There are several methods that you can use to edit .htaccess file, here we will tell you about three methods.

  1. From the Yoast SEO plugin

  2. From the cPanel

  3. Using WP File Manager plugin


But before that, we will know What is the htaccess file.

When we install a WordPress site, the htaccess file is created in the root folder of WordPress installation. You can see it by going to cPanel >> File Manager >> Public_html.

If the .htaccess file is not present in Public_html then you can create it manually by reading this article on ShoutMeLoud - How to Create WordPress .Htaccess File

What are the benefits of WordPress .htaccess file

  • You can fix error pages in your site.

  • Protect your site with a password.

  • Enable server-side includes.

  • You can deny the visitor to access your site based on IP.

  • Change your default directory page (index.html).

  • Redirect visitors to another page.

  • Prevent directory listing and many more.


So, let's get started how to edit .htaccess file...

How to Edit .htaccess File in WordPress


Here we will tell you 3 methods that you can easily edit your .htaccess file. But before start editing, take a backup of your .htaccess file.

So let's start...

1. From the Yoast SEO plugin


If you use the Yoast SEO plugin on your site, you can easily edit the htaccess file.

Simply click on SEO >> Tool >> File editor.

How to Edit .htaccess File in WordPress

This tool allows you to quickly change important files, like your robots.txt and .htaccess file. The first box is for Robots.txt editing, so to edit the htaccess file, scroll to the second box.

How to Edit .htaccess File in WordPress

Now you can add the required code to the .htaccess file.

2. From the cPanel


Just go to your web hosting and login to your cPanel then click on File Manager >> Public_html. Here you will see .htaccess file.

Now select the .htaccess file and click on Edit buttonThis will open the editor in a new tab. Here you can make changes in your .htaccess file.

3. Using WP File Manager plugin


Go to the WordPress Plugin page and install WP File Manager on your site. After activating the plugin click on WP File Manager. Here you will not need to do anything Simply select your .htaccess file and click on the Edit file to make changes.

How to Edit .htaccess File in WordPress

You can post/comment here for any type of question or suggestion related to this article.

Find this article helpful? Don't forget to share!

Comments

Popular posts from this blog

Fix Submitted URL marked ‘noindex’ in Google Search Console Tool 2018

Keep these 12 things in mind before applying to Google AdSense

What is Google Adsense and How much you can make money