Why to use .htaccess file in apache?

July 18, 2016 275 views


Sorry if this a dumb question, Why to use .htaccess file in apache? if I have direct access to the apache configuration files themselves and also you told any directive placed in the .htaccess file, has the same effect as it would in the apache configuration itself.

2 Answers

There's no need when you run the server yourself. It's mainly used on shared hosting.

It can be used to manage multiple servers. If one website if hosted on multiple server (for redundency), you can simply upload your file just like any other web file, and all the htaccess config will be there.
Also, there is no need to reboot the server when you change the htaccess file

Have another answer? Share your knowledge.