Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache .htaccess vs httpd - does it really matter?

I know this question has been asked many times and I've researched it myself on Google as well but just can't come up with the answer I need.

My hosting company is NOT letting me use the httpd config file, instead it wants me to use .htaccess. I am not a server admin but I have to believe that there is a performance hit for using this file? I have a site with approx 5 million page views a month and it's growing. I do not have a lot of rewrite rules just some optimizations we make to serving pages faster ,mod_deflate, caching, etc.

Assuming there is a performance hit, my question is, how bad will it be on my site? Can .htaccess handle 5 million page views with some rewrite rules? How would I be able to test this if I wanted to?

Thanks.

like image 338
frio80 Avatar asked Jun 09 '09 13:06

frio80


2 Answers

Yes, it does matter. qouting from http://wiki.apache.org/httpd/Htaccess:

The use of .htaccess files is discouraged as they can have a detrimental effect on server performance. Only use them when necessary.

like image 101
Nasser Al-Wohaibi Avatar answered Oct 02 '22 12:10

Nasser Al-Wohaibi


With my test (based on: http://www.fubra.com/blog/2008/01/07/htaccess-vs-httpdconf/), the result is: the performance difference is negligible.

5000 rounds:

# htaccess Disabled
real    1m1.069s
user    0m10.956s
sys     0m9.748s

# htaccess Enabled
real    1m1.658s
user    0m11.434s
sys     0m9.848s
like image 31
Eduardo Cuomo Avatar answered Oct 02 '22 12:10

Eduardo Cuomo