June 17, 2020
2min Read
Tomas A.
.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’s time zone or alter default index page, and much more. Here you’ll learn how to locate and create .htaccess file.
Upgrade your web hosting and try Hostinger today!
We will show how to locate and open .htaccess file in both Hostinger’s hPanel and cPanel.
Finding and editing the file in Hostinger‘s hPanel takes only a few clicks. Here’s how to do it:
If you are using cPanel, the process is more or less similar.
IMPORTANT! This only applies to cPanel-based hosting platforms.
If .htaccess file is not present, here’s how you create one. This method is applicable to both hPanel and cPanel:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPres
You’ve learned how to locate and create .htaccess file using the File Manager. .htaccess enables you to create website redirects, set default pages, password-protect directories and much more.
If you have any questions regarding this guide, let us know in the comments below!
April 13 2018
I'm 71and still have no idea how to get rid of 403 forbidden
Replied on April 28 2018
Hey Marshadeans, We have a tutorial on 403 error: https://www.hostinger.com/tutorials/what-is-403-forbidden-error-and-how-to-fix-it
August 07 2019
I can access my website using http:// but I can't access directly "tripticianandaman.in". How to solve this problem ????
Replied on September 24 2019
Hey Avinash, Most likely you need to create a redirect from http to https. See instructions how to do this here.
September 25 2019
Thank you for this post. this help me a lot. Good luck
March 11 2020
Hello Tomas, How can I get support from you on htaccess setting on Hostinger VPS for Laravel project? thanks!
Replied on March 12 2020
Hi Fulvio, Here are the tutorials we have on htaccess (https://www.hostinger.com/tutorials/htaccess/) You can always contact the Hostinger via chat support. :)
August 31 2020
Can we use this for using a site without publishing it, I mean by using an html file on our desktop while testing it?
Replied on November 11 2020
Hey there. What you are describing would be testing a website locally. You can test your site locally, of course, but you can't use this guide to locate the .htaccess file, as your local computer is not using our hPanel which the guide is about. :)
marshadeans
Replied on April 13 2018
I'm 71 and tried for ages I can't get rid of 403 forbidden I have,nt a clue what I'm doing.