views:

30

answers:

1

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.

+1  A: 

Should i be keeping it on code base or on the individual apache servers.

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.dist in the code base containing any global configuration values specific to the application (URL rewriting etc.) and a local .htaccess containing the global values plus your local settings. The .htaccess would never get checked in to your code base in this scenario.

How can i write the same stuff that i have written in .htaccess file to httpd.conf file.

Usually by just putting the settings into the appropriate Directory, Location or VirtualHost sections. The manual will tell you which belong where.

Pekka