On our local dev enviornment we had just one server and to add far future expires and cache control header to static images we kept a .htaccess file in the root of the application things worked fine. But on our prod we have multiple apache servers having aliases to a code base on a different server. Here in this case i am not sure where to keep .htacess file on. Should i be keeping it on code base or on the individual apache servers. How can i write the same stuff that i have written in .htaccess file to httpd.conf file.
Share
If it’s settings specific to the application, then I’d say in the code base.
If the file also contains settings specific to the server, consider keeping a
.htaccess.distin the code base containing any global configuration values specific to the application (URL rewriting etc.) and a local.htaccesscontaining the global values plus your local settings. The.htaccesswould never get checked in to your code base in this scenario.Usually by just putting the settings into the appropriate
Directory,LocationorVirtualHostsections. The manual will tell you which belong where.