the famous wpmu dev
Docs / / Editing Your .htaccess File

5. Editing Your .htaccess File

Written by Alex Stine | Last updated: January 4, 2017

In this doc, we will cover:

  • Editing your .htaccess file.
  • The code required by a WordPress installation.
  • The code required by a WordPress Multisite Network.

5.1 Editing Your .htaccess File

Link to chapter 1

When editing your .htaccess file, you will have to access your site via FTP or File Transfer Protocol. There are a number of FTP clients to help you with this based on whether you are using Windows or Mac.

Windows FTP Clients

Mac FTP Clients

You will need some information from your web host to access FTP. Most of this information can be found at your hosts control panel.

    • FTP Host
    • FTP Port
    • FTP Username
    • FTP Password

Some FTP clients hide hidden files such as the .htaccess file by default. Because of this you will need to enable display of hidden files.

If FTP sounds to scary to you, it really isn’t. It just takes some getting use to. However, most hosts have cPanel which contains a File Manager. If you are not sure if your host has a control panel such as cPanel, you should contact them directly.
Editing .htaccess In cPanel

5.2 Backing Up Your .htaccess File

Link to chapter 2

Before you go any further, it is highly recommended that you back your .htaccess file up so if needed, you can revert it to an earlier version. One of the things you can do is simply download the file to your computer using your FTP Client or cPanel File Manager. Another way is to backup your website using our Snapshot Pro plugin if you already have an existing WordPress installation.

5.3 Code Required For Your WordPress Installation

Link to chapter 3

Once you have backed up your site, you will want to login using your FTP client. From here, you will want to navigate to “/public_html/.htaccess”. At this point, your .htaccess file should be open. Add one of the code snippets below to the top of your file based on what kind of WordPress setup you have at the top of your .htaccess file.

Single WordPress Installation

WordPress Multisite Installation

NOTE: Pay close attention, if you use Sub Domains, you will need different code than if you are using Sub Directories. More on that in the below doc.
WordPress Multisite

Sub Directory Installation

Sub Domain Installation

Don’t forget to save and re upload the file when you are done.

Get help and support for ANY WordPress problem for FREE

Want expert help and support for ANY WordPress issue for free?

Sign up for a free trial now and let us help you out!

No obligation and super easy to cancel.

Awesome! Let’s get you set up with your free 30 day trial


Example: John
Already have a WPMU DEV account? Log In