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

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.