{"id":1535,"date":"2019-02-08T10:35:56","date_gmt":"2019-02-08T10:35:56","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2019\/02\/08\/1583307-how-to-create-an-htaccess-file-at-hostinger\/"},"modified":"2026-03-16T12:12:17","modified_gmt":"2026-03-16T12:12:17","slug":"1583307-how-to-create-an-htaccess-file-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/1583307-how-to-create-an-htaccess-file-at-hostinger\/","title":{"rendered":"How to Create an .htaccess File at Hostinger"},"content":{"rendered":"<p class=\"no-margin\">.htaccess (hypertext access) is a configuration file used to set up some rules related to a website&rsquo;s access. Since this file is optional, you may need to create it in order to add certain instructions &ndash; for example, a redirect or to force HTTPS.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To create an .htaccess file from your panel, go to <b><a href=\"https:\/\/hpanel.hostinger.com\/websites\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Websites<\/a> &rarr; Dashboard<\/b>, search for <b>File Manager <\/b>on the sidebar and click on it:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/658b2e76-db4d-4fc7-ab06-acc8da205101.jpg\"><\/div><p class=\"no-margin\">Navigate to the folder where you wish to create the .htaccess file and click on <b>New File <\/b>on the left:<b> <\/b><\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/ced3827b-a444-4890-b464-b2602c63fb51.jpg\"><\/div><p class=\"no-margin\">Enter the name <code>.htaccess<\/code> (make sure the dot is added at the beginning) and click on <b>Create<\/b>: <\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/615e5da9-90f8-44c6-bad6-34e547d72fdc.jpg\"><\/div><hr><h2 id=\"creating-htaccess-file-in-cpanel\">Creating an .htaccess File in cPanel<\/h2><p class=\"no-margin\">In case you&rsquo;re using cPanel, all you need to do is open your <b>cPanel<\/b> account and select the <b>File Manager<\/b>:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"https:\/\/blog.hostinger.io\/pt\/support\/wp-content\/uploads\/sites\/59\/2022\/09\/9d303c88-7908-4a0d-8f51-2812451c2c08.jpg\"><\/div><p class=\"no-margin\">Open the needed directory. If you want the rules in the file to apply to the whole website, you need to open <b>public_html<\/b>.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Then click on the <b>+ File<\/b> icon:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"https:\/\/blog.hostinger.io\/pt\/support\/wp-content\/uploads\/sites\/59\/2022\/09\/55fd4585-e301-4f79-a5ee-a65145b350e1.jpg\"><\/div><p class=\"no-margin\">Input &ldquo;.htaccess&rdquo; (make sure the dot is added at the beginning) and click on <b>Create<\/b>: <\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"https:\/\/blog.hostinger.io\/pt\/support\/wp-content\/uploads\/sites\/59\/2022\/09\/3eadc86c-73db-4866-97b1-c887d55f7585.jpg\"><\/div><p class=\"no-margin\">In case you don&rsquo;t see .htaccess on your public_html, try <b><a href=\"\/support\/4622407-how-to-show-hidden-files-htaccess-in-cpanel-file-manager\" target=\"_blank\" class=\"intercom-content-link\">enabling hidden files<\/a><\/b>. <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">That&rsquo;s it! your .htaccess file is created and you can now edit it &#128522;<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Additional resources<\/b>:<\/p><ul>\n<li>\n<p class=\"no-margin\"><b><a href=\"\/support\/4548688-basic-actions-in-file-manager\" target=\"_blank\" class=\"intercom-content-link\">Basic actions in File Manager<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b><a href=\"\/support\/1583355-how-to-block-ip-using-htaccess-file\" target=\"_blank\" class=\"intercom-content-link\">How to block IP using the .htaccess file<\/a><\/b><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Creating an .htaccess file at Hostinger<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[237],"tags":[],"class_list":["post-1535","post","type-post","status-publish","format-standard","hentry","category-htaccess-file"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/1583307-how-to-create-an-htaccess-file-at-hostinger\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/1583307-como-crear-un-archivo-htaccess-en-hostinger\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/1583307-comment-creer-un-fichier-htaccess-hostinger\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/1583307-cara-membuat-file-htaccess-hostinger\/","default":0},{"locale":"lt-LT","link":"https:\/\/www.hostinger.com\/lt\/support\/1583307-kaip-sukurti-htaccess-faila-hostinger-platformoje\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/1583307-como-criar-um-arquivo-htaccess-hostinger\/","default":0},{"locale":"uk-UA","link":"https:\/\/www.hostinger.com\/ua\/support\/1583307----htaccess--hostinger\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1535"}],"version-history":[{"count":1,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1535\/revisions"}],"predecessor-version":[{"id":5362,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1535\/revisions\/5362"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}