To create a site-wide .htaccess file in Hostinger, open Websites → Dashboard for the site, launch File Manager, open public_html, and create a new file named exactly .htaccess. Put it in a subfolder instead if its rules should apply only there. The file is optional, and this file-based method does not apply to AI Builder sites.
How to create the file in Hostinger File Manager
-
Sign in to your hosting account and go to Websites → Dashboard for the website you want to change.
As an Amazon Associate I earn from qualifying purchases.
-
Open File Manager from the dashboard sidebar.
-
Navigate to the directory where the rules should apply. For site-wide rules, use
public_html, the site root identified in Hostinger’s creation instructions.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Check whether
.htaccessalready exists in that directory. Hostinger’s File Manager displays dotfiles by default.#1 Best Overall
-
If it is absent, choose New File, enter
.htaccesswith the leading dot, and click Create. -
Add only the configuration your site needs, then save the file. Creating the file does not require adding a generic set of rules.
Put the file in the directory that matches its scope
A file in public_html is the usual location for rules intended for the site as a whole. If a rule should affect only a particular subfolder or subdomain, place the file in the directory corresponding to that part of the site. Rules in the wrong directory may not apply to the content you intended to change.
Hostinger’s guidance also uses directory-specific placement for configuration changes affecting subfolders or subdomains; see its instructions on changing the PHP version for subfolders or subdomains.
Rank #3
Check whether your site uses .htaccess
Hostinger describes .htaccess as supported but optional for its web, cloud, and agency hosting. Its guidance excludes AI Builder sites: they do not use this file-based setup. Confirm the type of site before following the steps as if they apply universally. See Hostinger’s .htaccess creation guide.
Hostinger says web and cloud hosting use LiteSpeed and that mod_rewrite is enabled by default on those plans. That context can make common rewrite rules relevant, but it does not mean every Apache directive is supported or appropriate for every account. Hostinger explains its file-transfer and server-access options.
Rank #4
If you cannot see an existing .htaccess file
The filename begins with a dot, so some FTP programs may hide it. In FileZilla, use Server → Force showing hidden files, then check the target directory again. Hostinger says its File Manager shows dotfiles by default. These visibility details are covered in its creation guide.
Use application-specific rules, not a universal template
Creating an empty file is different from configuring it. The directives you add depend on the application and the behavior you want. For example, WordPress rewrite rules are a WordPress-specific configuration, not a required starter block for every website. Hostinger’s WordPress .htaccess instructions present those rules in that CMS context.
Best Value
Before editing an existing configuration file, make a copy so you can restore it if a change causes errors. Hostinger also advises caution when changing system files; its File Editor instructions describe the editing workflow.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




