{"id":553,"date":"2019-10-31T13:13:21","date_gmt":"2019-10-31T13:13:21","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/htaccesshow-to-locate-htaccess-file-on-cpanel-file-manager\/"},"modified":"2026-03-09T19:19:28","modified_gmt":"2026-03-09T19:19:28","slug":"locate-and-create-htaccess","status":"publish","type":"post","link":"\/ng\/tutorials\/locate-and-create-htaccess","title":{"rendered":"How to locate and create .htaccess file \u2013 A step-by-step guide"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p><strong>.htaccess <\/strong>(hypertext access) is a hidden file used to configure additional features for websites hosted on Apache Web Server. With it, you can rewrite URL, password-protect directories, enable hotlink protection, disallow access to specific IP addresses, change your website&rsquo;s time zone or alter default index page, and much more. Here you&rsquo;ll learn how to locate and create <strong>.htaccess<\/strong> file.<\/p><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-locate-an-open-htaccess-file\">How to Locate an Open .htaccess File?<\/h2><p>We will show how to locate and open .<strong>htaccess<\/strong> file in both Hostinger&rsquo;s hPanel and cPanel.<\/p><h3 class=\"wp-block-heading\" id=\"h-hpanel\"><strong>hPanel<\/strong><\/h3><p>Finding and editing the file in Hostinger&rsquo;s hPanel takes only a few clicks. Here&rsquo;s how to do it:<\/p><ol class=\"wp-block-list\">\n<li>Once you&rsquo;re logged in to your WordPress Dashboard, use the search feature to find the <strong>File Manager<\/strong> located under the <strong>Files<\/strong> category.<\/li>\n\n\n\n<li>By default, .<strong>htaccess <\/strong>is visible in hPanel&rsquo;s <strong>public_html<\/strong> directory, so you can immediately access the file and its content by right-clicking and selecting <strong>Edit<\/strong>.<img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"484\" class=\"wp-image-81453\" style=\"width: 1000px\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/10\/filemanager-publichtml-htaccess-edit.png\" alt=\"The Edit option for the .htaccess file highlighted in the public_html folder on hPanel's File Manager\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/10\/filemanager-publichtml-htaccess-edit.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/10\/filemanager-publichtml-htaccess-edit.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/10\/filemanager-publichtml-htaccess-edit.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/10\/filemanager-publichtml-htaccess-edit.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/>\n<ul class=\"wp-block-list\">\n<li>\n<\/li><\/ul>\n<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-cpanel\"><strong>cPanel<\/strong><\/h3><p>If you are using cPanel, the process is more or less similar.<\/p><ol class=\"wp-block-list\">\n<li>Access&nbsp;<strong>File Manager&nbsp;<\/strong>&rarr; <strong>public_html<\/strong>.<\/li>\n\n\n\n<li>If you can&rsquo;t find the file, go to the&nbsp; <strong>Settings <\/strong>on the upper right menu and tick the&nbsp;<strong>Show Hidden Files&nbsp;<\/strong>option to enable viewing.<\/li>\n<\/ol><p><div><p class=\"important\"><strong>Important!<\/strong> This only applies to <a href=\"\/ng\/cpanel-hosting\">cPanel-based hosting<\/a> platforms.<\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-create-htaccess-file\">How to Create .htaccess File?<\/h2><p>If <strong>.htaccess<\/strong> file is not present, here&rsquo;s how you create one. This method is applicable to both hPanel and cPanel:<\/p><ol class=\"wp-block-list\">\n<li>Click the <strong>New File&nbsp;<\/strong>button in the upper menu.<\/li>\n\n\n\n<li>Enter .<strong>htaccess&nbsp;<\/strong>as the file name, insert the code below and press <strong>Create <\/strong>to save your changes.\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\"># BEGIN WordPress\n&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteBase \/\nRewriteRule ^index.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . \/index.php [L]\n&lt;\/IfModule&gt;\n# END WordPres<\/pre>\n<\/li>\n<\/ol><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-full\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-web-hosting\" href=\"\/ng\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/public\" alt=\"Hostinger web hosting banner\" class=\"wp-image-98604\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>You&rsquo;ve learned how to locate and create <strong>.htaccess<\/strong> file using the <strong>File Manager<\/strong>. <strong>.htaccess <\/strong>enables you to create website redirects, set default pages, password-protect directories and much more.<\/p><p>If you have any questions regarding this guide, let us know in the comments below!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.htaccess (hypertext access) is a hidden file used to configure additional features for websites hosted on Apache Web Server. With it, you can rewrite URL, password-protect directories, enable hotlink protection, disallow access to specific IP addresses, change your website&rsquo;s time zone or alter default index page, and much more. Here you&rsquo;ll learn how to locate [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/locate-and-create-htaccess\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":37,"featured_media":144978,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Locate and Create the .htaccess File \u2013 A Step-by-Step Guide","rank_math_description":"Want to create website redirects or set default pages? Here you'll learn to locate and create the .htaccess file in both hPanel and cPanel.","rank_math_focus_keyword":"create htaccess file","footnotes":""},"categories":[22630],"tags":[],"class_list":["post-553","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-aspects"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/locate-and-create-htaccess","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-localizar-ou-criar-um-arquivo-htaccess","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/trouver-creer-htaccess","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/que-es-el-archivo-htaccess","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-membuat-htaccess-file","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/locate-and-create-htaccess","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/locate-and-create-htaccess","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/locate-and-create-htaccess","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/que-es-el-archivo-htaccess","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/que-es-el-archivo-htaccess","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/que-es-el-archivo-htaccess","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-localizar-ou-criar-um-arquivo-htaccess","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/locate-and-create-htaccess","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/locate-and-create-htaccess","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/locate-and-create-htaccess","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/locate-and-create-htaccess","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=553"}],"version-history":[{"count":25,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"predecessor-version":[{"id":144977,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/553\/revisions\/144977"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media\/144978"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}