InfoPhilic WordPress How To Edit WordPress .htaccess File

How To Edit WordPress .htaccess File

Hello, in my recent tutorials you have learned to tighten blog security and to enable a gzip compression using a .htaccess file on your server. Today in this tutorial I am sharing ways to access and edit .htaccess file on your server.

First, let me tell you why do we use the .htaccess file on the server. We use the .htaccess file to configure the server. Most of the bloggers use shared or managed hosting where you have to contact host provider whenever you need any modification on the server. So this is a bit time-consuming process.

So to overcome this, there is a file named .htaccess. You have to put this file in the WordPress directory to make changes for the particular website. You are allowed to use multiple .htaccess files to manage your websites.For example, use different .htaccess files for your sub-directories.

Ways to access .htaccess file

Following are the three typical ways to access your .htaccess file so that you can edit it.

  1. cPanel’s File Manager
  2. An FTP client such as Filezilla
  3. Yoast SEO plugin (note! use only for small, safe edits)

One mistake and your site will disappear

Any single mistake in .htaccess file result in the web server return a blank page or error 500. So some precaution should be taken while updating .htaccess file.

Always make a backup copy of the current .htaccess file.

You can save the backup on your desktop so that if anything goes wrong, it will be easy to restore the backup file.

After a successful edit, do check your website in the different browser. Clear browser cookies and cache, this reduces the risk of picking up a cached page.

Don’t use Yoast SEO for having significant changes in .htaccess because if you broke up with your site, you can’t restore the backup using Yoast SEO plugin.

Edit .htaccess File Using cPanel File Manager

Editing .htaccess file using cPanel file manager is the recommend method as it offers powerful direct editing of the .htaccess file, and is accessible whether the file contains an error or not.

To edit .htaccess file using cPanel file manager follow the steps:

  1. Log into the cPanel
  2. Scroll down and click File Managercpanel_file_maneger
  3. Check the option to show the hidden files in File Manager
  4. In File manager find public_html
  5. Navigate to the root folder of the website whose .htaccess file you want to edit.
  6. Select .htaccess file, right click and choose Code Edit. You can select Download option to make a backup file on your desktop.edit htaccess in file manager
  7. Make your edits and save changes from top right corner.
  8. Don’t forget to check your site after edits.

Edit .htaccess File Using FTP Client

To use this method, you can use FileZilla as FTP Client. By using FTP Client, you can make a backup file of your current .htaccess file on your desktop. It is also a safe way to edit .htaccess file.

To edit .htaccess file using FTP, all you have to follow steps:

  1. Connect your website using FTP Client (FileZilla).
  2. Navigate to the root directory of your site.
  3. Drag and drop .htaccess file from FileZilla to the desktop.
  4. Edit .htaccess file using an editor like, Notepad or Notepad ++.
  5. After editing, upload it to the directory.

edit using ftp

Don’t forget to check your website working after updating .htaccess file. If your site shows a blank page, you can upload the backup file to fix it.

Edit .htaccess file using Yoast SEO Plugin

Don’t use this method to make major modification in the .htaccess file. Because if anything goes wrong site will disappear and you will not able to fix it using the plugin. Instead, you can use cPanel or FTP to fix it.

To edit .htaccess file follow the steps bellow:

  1. Log in to the WordPress dashboard
  2. Navigate to SEO option on the left navigationSEO option
  3.  Choose File editorFile editor
  4. Edit .htaccess and Save changesedit htaccess


So, these are the best three ways to edit .htaccess file on your web server. I repeat, don’t forget to make a backup of current .htaccess file before you make any changes in it.

Amit Malewar
Amit Malewar has been the tutorial writer since 2013. His passion for helping people in all aspects of technology flow through the expert coverage he provides. In addition to writing for InfoPhilic, Amit loves to read and try new things.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.


Please enter your comment!
Please enter your name here

Join InfoPhilic Community!

Let's build a community (Facebook Group) to help & encourage each other to grow!


Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You...

How To Reduce Admin-Ajax Server Load In WordPress

To increase better user experience, we always end up by increasing site speed. After clicking a website link seems like a simple...

How to Delete Multiple Images in WordPress Media Gallery

Hey, guys today one of my friends asked me a question, How can I delete Multiple Images in WordPress? I replied, "It's very simple." Yeah,...

How to create News Sitemap for WordPress site?

Learn how to create special news sitemap for your WordPress blog/ website using Yoast News SEO plugin and Jetpack plugin.

WP Super Cache Plugin: Best Settings & Configuration Guide

A cache plugin serves static contents to the visitor which improves page load speed. There are so many cache plugins available in the...


Start your blog or website with Dreamhost

Learn how to start your WordPress blog with Dreamhost hosting. Discover the steps it takes to create a blog in 2020.

Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...


Genesis Framework

The Genesis Framework empowers you to quickly and easily build incredible websites with WordPress.