How to Create an .htaccess File at Hostinger

Creating an .htaccess file at Hostinger

Updated 2 weeks ago

.htaccess (hypertext access) is a configuration file used to set up some rules related to a website’s access. Since this file is optional, you may need to create it in order to add certain instructions – for example, a redirect or to force HTTPS.

To create an .htaccess file from your panel, go to Websites → Dashboard, search for File Manager on the sidebar and click on it:

Hostinger hPanel sidebar with File Manager highlighted under File menu

Navigate to the folder where you wish to create the .htaccess file and click on New File on the left:

File manager menu with the New file option highlighted

Enter the name .htaccess (make sure the dot is added at the beginning) and click on Create:

Hostinger file dialog with .htaccess entered and the Create button highlighted

Creating an .htaccess File in cPanel

In case you’re using cPanel, all you need to do is open your cPanel account and select the File Manager:

Open the needed directory. If you want the rules in the file to apply to the whole website, you need to open public_html.

Then click on the + File icon:

Input “.htaccess” (make sure the dot is added at the beginning) and click on Create:

In case you don’t see .htaccess on your public_html, try enabling hidden files.

That’s it! your .htaccess file is created and you can now edit it 😊

Additional resources: