Forum Moderators: phranque

Message Too Old, No Replies

htaccess file size

         

Champak

3:27 pm on Feb 16, 2007 (gmt 0)

10+ Year Member



I have a website that is going to have a lot of subdomains, upwards of 200 by the end of the year. I do not like all the folders that get created with the subdomains...(I could maybe accept if the created subdomain folders could all go in one folder in the public_html ex./public_html/subfolders/allsubdomains), so I delete all of the folders and put the htaccess info that is in that folder in the main htaccess. Generally, the htaccess file seems like a transparent file, from my limited understanding, where it doesn't really affect all actions on the site. My questions are:

1/ Does it affect general speed of the site?
2/ Is the size significant(which I guess would be answered by 1)?
3/ What do you believe would be the maximum acceptable size of the htaccess?
4/ Is there another way I can delete the created subdomain folders and not pack up the main htaccess with the info and everything will still work?

webdoctor

7:43 am on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do not like all the folders that get created with the subdomains...

You haven't really told us much about your hosting setup. On systems I configure, each subdomain gets a separate folder, but these don't live UNDER the main domain folder, they live at the same level as it.

So, if we're hosting www.example.com, its content might live at /vhosts/www.example.com. If I create newyork.example.com, its content lives at /vhosts/newyork.example.com - so a large number of subdomains doesn't make it any harder to work with stuff in the www.example.com folder.

Perhaps you need to either (a) talk to your host, or (2) talk to your sysadmin, or [if you ARE the sysadmin] (3) re-think your filesystem layout and webserver configuration.

1. Does it affect general speed of the site?

The answer is "YES, it can".

If you've ever set up multiple mod_rewrite rules and then turned on detailed logging you'll have seen that if you have a .htaccess in your webroot, it basically gets parsed/processed for every request your server processes. More parsing/processing = less speed.

2. Is the size significant(which I guess would be answered by 1)?

Yes, a longer .htaccess definitely longer to parse. Of course, if you've got CPU cycles and RAM to spare, you might not notice at all - it could be 2ms instead of 0.1ms and your vistors won't notice. If your server is heavily loaded, you might see a significant slow-down.

3. What do you believe would be the maximum acceptable size of the htaccess?

Sounds very much like: "How long is a piece of string" :-)

I've got .htaccess files many hundreds of lines long, the server is still OK. I've got plenty of horsepower on that server, though. YMMV.

4. Is there another way I can delete the created subdomain folders and not pack up the main htaccess with the info and everything will still work?

Choose a better filesystem layout and webserver configuration.

Champak

9:36 am on Feb 22, 2007 (gmt 0)

10+ Year Member



thanks