Forum Moderators: phranque

Message Too Old, No Replies

how many htaccess files do you have?

one big or for each real dir?

         

koen

12:32 am on Nov 11, 2005 (gmt 0)

10+ Year Member



I mean, would it be better to try to incorporate all the smaller ones into a big one at document root? Or is it easier to keep them as they come with each program that is in a subdirectory (eg one for wordpress, one for phpbb etc)?

jdMorgan

8:31 am on Nov 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's really a matter of preference, server eficiency, and ease of maintenance.

It's more efficient to have small .htaccess files to control access and set cache controls for various parts of your site (subdirectories).

It can be easier to maintain one big .htaccess file (well, as long as it doesn't get too big.)

I tend to use one big .htaccess file in the Web root until it gets out of hand size-wise, and then break out a separate .htaccess file for images and media, scripts, etc. when the one file just gets too large to handle. But how large is too large? I've got one that's still comfortable at 40kB right now. It'll get much (33%) smaller when I go clean out the IP access blocks on the one-time drive-by scrapers who hit a trap script, but it's still manageable even at that size -- and I personally think 40kB is 'too big' efficiency-wise. But then again, I believe in letting the computers do the work. I used to design them, and that's what they're for. :)

Jim