New Check out the curated list of the finest design resources I've gathered for you! Take a look →

How to Create a WordPress htaccess File

This guide will walk you through the process of creating a htaccess file for your WordPress installation. The htaccess file is an essential component for a well-functioning WordPress website, as it provides additional features and security settings for your web server.


For this tutorial, you need:

  • An active cPanel account
  • Access to the File Manager in cPanel

Step-by-Step Tutorial: Creating a WordPress htaccess File

  1. Log in to your cPanel account. To start, login to your cPanel account.
  2. Choose the File Manager option.
  3. Locate the WordPress htaccess file.

Click on the public_html folder. Then, click on the "+File" button and enter ".htaccess" as the file name. Finally, click on the “Create New File” button.

  1. Edit the htaccess file.

Right-click on the newly created .htaccess file and select the “Edit” option.

  1. Insert the following code:
# BEGIN WordPress
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
  1. Save the changes to the htaccess file.

After inserting the code, do not forget to click the “Save Changes” button.

Wrapping Up

In conclusion, creating a htaccess file is crucial for the proper functioning of your WordPress website. This file provides additional features and enhances security settings, including spam prevention and blocking of malicious visitors.

Rizwan Aritonang

An independent WordPress & Front-End Developer from Bandung, Indonesia.

Get In Touch

Leave a Comment