.htaccess is a hidden file that is used for your website’s configuration. Using it, you can do URL rewriting, password protect directories, enable hotlink protection, disallow access to specific IP addresses, change your website’s time zone or default index page and much more. This tutorial shows how to locate (or create) .htaccess file by using File Manager in your hosting control panel.
What you’ll need
Before you begin this guide you’ll need the following:
- Access to hosting account’s control panel
Table of Contents
Step 1 — Locating and Opening File Manager
Navigate to your hosting account’s control panel and open up the File Manager tool located in the Files category:
If you are using cPanel, the section can also be found under the Files category.
Step 2 — Locating .htaccess file in File Manager
.htaccess file is located in your public_html directory. You can quickly access the file and it’s content by right-cliking and selecting Edit:
If your hosting platform uses cPanel, the process is more or less the same.
In case there is no .htaccess file, check if Show Hidden Files is enabled in your File Manager settings:
IMPORTANT! This only applies to cPanel based hosting platforms.
Step 3 — Creating .htaccess file if it is not present
If the .htaccess file still has not appeared, simply create it by right-clicking on a blank area in your File Manager and select New File option.
After that, enter the name
.htaccess and press Create to save it. You will then be able to access your newly created file and manage the code.
Looking for a better way to host your website?
Transfer your website to the fastest web hosting platform with 24/7 dedicated support.
The process creation process is almost the same for cPanel based webhosting platforms. To generate the new file, you will need to press File section inside your File Manager:
You have learned how to locate the .htaccess file using File Manager located in the hosting control panel. Knowing how to locate or create and edit .htaccess file will empower you to create website redirects, set default pages, password protect directories and much more.