{"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-10-29T15:08:19","modified_gmt":"2026-10-29T15:08:19","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 a .htaccess file at Hostinger"},"content":{"rendered":"<p>Create a .htaccess file at Hostinger with File Manager, or reveal an existing hidden one in your FTP client. A <code>.htaccess<\/code> (hypertext access) file sets server rules for a website, such as forcing HTTPS or setting up redirects. Because the file is optional, it may not exist until you create it.<\/p><h3>Before you start<\/h3><ul>\n<li>This guide applies to web, cloud, and agency hosting plans.<\/li>\n<li>Hostinger web servers fully support <code>.htaccess<\/code> rules, but they are not mandatory. Ensure your website application requires this file before creating it.<\/li>\n<li>Hostinger AI Builder do not use a file-based structure, so <code>.htaccess<\/code> configurations do not apply to them.<\/li>\n<\/ul><h2 id=\"h-option-1-find-or-create-the-file-using-file-manager\">Option 1 &ndash; Find or create the file using File Manager<\/h2><p>Since the Hostinger File Manager displays all files (including hidden dotfiles) by default, a missing <code>.htaccess<\/code> file means it does not exist yet and needs to be generated.<\/p><ol>\n<li>Access the <a data-click-id=\"hgr-post-content-link-hostinger-file-manager\" href=\"\/support\/4548688-basic-actions-in-the-file-manager-in-hostinger\/\">Hostinger File Manager<\/a> for your website.<\/li>\n<li>Open the <code>public_html<\/code> folder.<\/li>\n<li>Check the file list. If the file is missing, click the New File icon in the sidebar.<br>\n<img decoding=\"async\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2019\/02\/ced3827b-a444-4890-b464-b2602c63fb51.jpg\/public\" alt=\"File manager menu with the New file option highlighted\" data-media-id=\"5357\"><\/li>\n<li>Name the file <code>.htaccess<\/code> and click <strong>Create<\/strong>. Always include the period at the beginning of the filename (<code>.htaccess<\/code>), or the server will not recognize it.<img decoding=\"async\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2019\/02\/615e5da9-90f8-44c6-bad6-34e547d72fdc.jpg\/public\" alt=\"Hostinger file dialog with .htaccess entered and the Create button highlighted\" data-media-id=\"5359\"><\/li>\n<\/ol><p>On the <a data-click-id=\"hgr-post-content-link-file-editor\" href=\"\/support\/7949267-how-to-use-the-file-editor-at-hostinger\/\">file editor<\/a>, enter the content for the file and save the changes.<\/p><h2 id=\"h-option-2-reveal-hidden-files-in-an-ftp-client\">Option 2 &ndash; Reveal hidden files in an FTP client<\/h2><p>If you are managing your website files <a data-click-id=\"hgr-post-content-link-via-an-ftp-client\" href=\"\/support\/4480505-how-to-connect-to-your-hosting-using-ftp-in-hostinger\/\">via an FTP client<\/a> like FileZilla, hidden files may be filtered out by default.<\/p><ol>\n<li>Connect to your hosting plan via FileZilla.<\/li>\n<li>Navigate to the top menu bar and click <strong>Server<\/strong>.<\/li>\n<li>Select <strong>Force showing hidden files<\/strong>.<br>\n<img decoding=\"async\" class=\"aligncenter size-full wp-image-5285\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2019\/02\/102605f1-97e3-42f8-9046-b5c4d0b61626.jpg\/public\" alt=\"FileZilla menu showing the Force showing hidden files option highlighted\" width=\"461\" height=\"235\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2019\/02\/102605f1-97e3-42f8-9046-b5c4d0b61626.jpg\/w=461,fit=scale-down 461w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2019\/02\/102605f1-97e3-42f8-9046-b5c4d0b61626.jpg\/w=300,fit=scale-down 300w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><\/li>\n<\/ol><p>The file listing will refresh, and your <code>.htaccess<\/code> file will appear in your website directory. If the file is still missing, create it using the steps outlined in Option 1.<\/p><h2 id=\"h-common-htaccess-configurations-at-hostinger\">Common .htaccess configurations at Hostinger<\/h2><p>Once your .htaccess file exists, use it for configurations such as these:<\/p><ul>\n<li><a data-click-id=\"hgr-post-content-link-how-to-enable-geoip-at-hostinger\" href=\"\/support\/3738302-how-to-enable-geoip-at-hostinger\/\">How to enable GeoIP at Hostinger.<\/a><\/li>\n<li><a data-click-id=\"hgr-post-content-link-how-to-parse-php-in-html-files\" href=\"\/support\/1583190-how-to-parse-php-in-html-files\/\">How to parse PHP in HTML files.<\/a><\/li>\n<li><a data-click-id=\"hgr-post-content-link-how-to-add-a-file-extension-to-mime-types-at-hostinger\" href=\"\/support\/1583371-how-to-add-file-extension-to-mime-types-at-hostinger\/\">How to add a file extension to MIME types at Hostinger.<\/a><\/li>\n<li><a data-click-id=\"hgr-post-content-link-how-to-make-files-downloadable-upon-a-click-on-a-link\" href=\"\/support\/6987484-how-to-make-files-downloadable-upon-a-click-on-a-link\/\">How to make files downloadable upon a click on a link.<\/a><\/li>\n<\/ul><p>Your <code>.htaccess<\/code> file is now accessible, allowing you to manage your website&rsquo;s server configurations and permissions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create a .htaccess file at Hostinger with File Manager or reveal a hidden one in FileZilla to set server rules like HTTPS and redirects.<\/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-BR","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-\u044f\u043a-\u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438-\u0444\u0430\u0439\u043b-htaccess-\u043d\u0430-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":10,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1535\/revisions"}],"predecessor-version":[{"id":23409,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1535\/revisions\/23409"}],"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}]}}