Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 Boilerplate .htaccess vs httpd.conf

I'd like to start off by saying I am really new to working with apache, so please don't hold it against me.

The HTML5 Boilerplate comes with a .htaccess file, but I'm using django (on webfaction) and so I have a httpd.conf file for apache. Can I put the code that's in the Boilerplates .htaccess file into my httpd.conf? I'm confused at the difference between the two and would appreciate any help / insight you can give?

like image 342
imns Avatar asked Apr 02 '11 15:04

imns


1 Answers

Most/all of the rules in the boilerplate's .htaccess can be moved to httpd.conf, and in fact this will give a small performance boost, because the httpd.conf file only needs to be loaded once by Apache, whereas it needs to read the .htaccess on every page load. This of course also means that changes to httpd.conf will need a daemon restart (sudo apache2ctl -k graceful or similar.)

In general, you put things that are relatively "static" in httpd.conf, and things that you might want to edit easily and without restarting the Apache daemon, in .htaccess. On shared hosts, the customer can typically only use .htaccess to modify the server behavior, so in that case that's the only choice you have.

like image 154
nitro2k01 Avatar answered Nov 20 '22 04:11

nitro2k01