How To Edit Your .htaccess File

What is .htaccess file?
"The .htaccess file in your account is a plain text file that provides a way to make configuration changes to your website."


  1. Loging into your cPannel.
  2. Click on the File Manager icon under the Files area
  3. Select the document root folder for the domain you want to edit the .htaccess file for.
  4. Make sure you select the option for Show Hidden Files (dotfiles).

    select show hidden files-cpanel file manager

  5. In the cPanel File Manager select the .htaccess file and make a copy of it by selecting Copy in the File Manager menu

    select copy option

  6. In the dialog window that appears, type in the name you want for your .htaccess backup and click the Copy File(s) button. In this example, we are naming the file ".htaccess_bk"

    change name of the .htaccess file screen shot

  7. This will create a backup of your .htaccess file

    create the new back up .htaccess file

  8. Now we are readty to open the .htaccess file for editing. Click on the .htaccess file and select either Edit or Code Editor in the File Manager menu.

    open .htaccess file for editing

  9. Please use the following steps to re-enable WP admin area (this will enable admin area access to your own PC)
    add this rule in their .htaccess
    <Files ~ "^wp-login.php">
    	Order deny,allow
    	Deny from all
    	Allow from x.x.x.x
    </Files>
    replace x.x.x.x with their ip what they get from www.whatismyip.com
    BeforeAfter
    word press code before word press code after

  10. Once your edits to the .htaccess file are complete, click on the Save Changes button in the upper right of the page and then click the Close button to close the file and return to the File Manager.