Why to use .htaccess file in apache?


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.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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

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