How To Edit WordPress .htaccess File

Earlier, I posted about the WordPress .htaccess file.

Here I’m sharing a quick tutorial on how to edit your WordPress .htaccess file.

There are many methods which you can follow, and here we will look into three of them:

  1. From the cPanel.
  2. From the WordPress dashboard.
  3. Using a desktop FTP client.

Moreover, when you edit your WordPress permalinks, you need to update your .htaccess file. If you are a self-hosted WordPress user, you should know about the .htaccess file and how to edit it.

How to edit WordPress .htaccess file using cPanel:

Most web hosting companies offer cPanel, which makes it easier for non-technical people to play around with and edit their .htaccess file.

The cPanel is especially useful for non-technical people who need to add or edit some codes. They can quickly do it using this online editor.

First, log in to your cPanel. Click on “File Manager” under the “Files” section.

 

Depending on your WordPress installation directory, you will find .htaccess at the root of your WP installation. If you don’t see it, refer to my create WordPress .htaccess notes to add one.

Select the .htaccess file and click on “Edit”. This will open the editor in a new tab and you can make changes right from there.

Edit WordPress .htaccess

 

Make changes and save the file.

Editing .htaccess from the WordPress dashboard:

There are many WordPress plugins which offer the feature to edit your .htaccess file from the WP dashboard. If you are using the SEO by Yoast plugin, you can access it from SEO by Yoast > Edit Files.

 

Editing .htaccess file using FTP client:

This is my favorite method as I love to do things on desktop, and because FTP clients give you more control.

Simply use any free FTP client like FileZilla and log in to your FTP hosting account. Browse to the root of your installation. You have to enable Show Hidden Items to see the .htaccess file.

Here is how you can enable it:

FileZilla Menu Options > Select Server > Force showing hidden files

Now navigate to the root folder of your domain. Your .htaccess file will be at the root of the folder.

Download your .htaccess file and start editing.

Make sure you take a backup of your .htaccess file before you start editing it. You can use your OS default text editor to edit the file, and once it’s edited, simply re-upload it back.

  • Make sure that the permission of your .htaccess file is 644 and not 777.

In upcoming posts, I will be sharing a couple of WordPress .htaccess hacks which will make your life easier.

You might also consider reading:

  • Step By Step Guide To Installing A Self-Hosted WordPress Blog
  • 8 Reasons Why A Self-Hosted WordPress Blog Is Better Than Free Blogs

Do let us know if you still have questions regarding the steps to edit your WordPress .htaccessfile.

Do subscribe to our email newsletter to receive more WordPress tutorials!

Leave a Reply

Your email address will not be published. Required fields are marked *