{"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-07-01T08:54:09","modified_gmt":"2026-07-01T08:54:09","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>A <code>.htaccess<\/code> (hypertext access) file is a configuration file used to set up server rules for a website, such as forcing HTTPS or setting up redirects. Because this file is optional, it may not exist for your website, or it might be hidden by your FTP client.<\/p><p>You can easily check for its presence, create a new one using the Hostinger File Manager, or configure your FTP client to reveal it.<\/p><h2 id=\"h-before-you-start\">Before you start<\/h2><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 Horizons and Hostinger Website 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 href=\"https:\/\/www.hostinger.com\/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=\"\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/ced3827b-a444-4890-b464-b2602c63fb51.jpg\" 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.\n<p><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/615e5da9-90f8-44c6-bad6-34e547d72fdc.jpg\" alt=\"Hostinger file dialog with .htaccess entered and the Create button highlighted\" data-media-id=\"5359\"><\/p><\/li>\n<\/ol><p>On the <a href=\"https:\/\/www.hostinger.com\/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 href=\"https:\/\/www.hostinger.com\/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:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/102605f1-97e3-42f8-9046-b5c4d0b61626.jpg\" alt=\"FileZilla menu showing the Force showing hidden files option highlighted\" width=\"461\" height=\"235\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/102605f1-97e3-42f8-9046-b5c4d0b61626.jpg 461w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/102605f1-97e3-42f8-9046-b5c4d0b61626-300x153.jpg 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><p>&nbsp;<\/p><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>Locate or create a .htaccess file using Hostinger tools<\/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----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":6,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1535\/revisions"}],"predecessor-version":[{"id":12243,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1535\/revisions\/12243"}],"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}]}}