.htaccess file on HostGator
.htaccess file is a configuration file of a Apache web server. .htaccess file is used to set up directory level configuration. Use of .htaccess file is not advisable due to performance issue. Enabling .htaccess file reduced the performance of the web server.
Why All Hosting Providers Give Access to .htaccess File?
Almost all hosting providers offer access to .htaccess file. Although the performance is degraded after enabling .htaccess option, customer gets the benefit of changing configuration file. If you want to change web server configuration for your web site and your site is hosted at shared hosting provider, you can do that by changing .htaccess file.
Most Basic Things You can Do with .htaccess
There are many benefits of using .htaccess file. Here are the few common ones.
-
Change default 404 page.
-
Block directory listing.
-
To consider .html file as php file.
-
To setup 301 redirect.
There are many other benefits also. These are just mostly used.
Where is .htaccess file located in HostGator?
.htaccess file is located in each directory. If it’s not there then you need to create one. The default directory for your web site is public_html in hostgator. So .htaccess file is located in public_html folder.
If want to change .htaccess file then you need to put it under public_html folder. If you didn’t find the file there then you can create .htaccess file and put it under public_html folder with your web site files.
.htaccess file is just simple text file. You can create it in notepad. Just create .htaccess file using notepad and upload it to public_html folder. Your server is now configured to use .htaccess file.
Back to Hostgator Tutorials
Go to Home
