I know this may sound silly as im instinct would tell me you only need one in the root... but as i go check my site i noticed there was .htaccess files in like 4 different places. One at the root where my CMS is located, one in its Admin folder, one in the folder that has my forum installation, and another one somewhere else. Most just have a few lines, not much at all... except the one in the root of course. Am i right in deleting all those other files? My site is www.dailysportspages.com, (although the bulk of the traffic goes to /forums) but folks can also get to it without using the www.... but i read somewhere that its not good to have both addresses doing that. That your users should get to your site from one or the other but not both. I read a little bit that using a redirect helps... so i tried doing that in the .htaccess but i ended up doing something wrong because the site stopped coming up when i did that. I deleted the file and uploaded a generic file from a site i was reading... maybe you guys could look it over and tell me what other things i would need to add/remove in order to fix this issue. Maybe some other code i could put in there to help with things like speed/cache, SEO, and anti leech protection. Im kinda stubborn in wanting to try to figure stuff out myself first, but this stuff doesnt come easy to me and most of my progress is very slow do to much trial and error error error error Thanks for the help.
- You can have as many .htaccess files as you have folders. So every folder can have it's own .htaccess file. Each .htaccess file has some apache directives that can affect other files in that same folder, or subfolders, or files in those subfolders, etc. Those "just a few lines" in some of your .htaccess files could be something very important, without which your forum or some other script on your site might not work properly. Sooo... it depends what does those "few lines" say... but I do not recommend deleting those .htaccess files if you are not 100% sure that you already have everything you need in your main html folder .htaccess file. - As for that www. or without www. question... I have all my sites working the same with www. or without www. I don't think I'm experiencing any negative points with Search Engines because of that. I wouldn't change there anything.
From what I have read in apache manual, you just need only one, and that is on the root folder, despite whatever the dynamic script tells you. Beware, it doesn't mean you should just go delete them, sometimes they are protecting configuration files and folders. For example, you install a SEO mod in phpbb, but have a wordpress on the root folder with htaccess first. Apache will read the first one (because your virtual host was set to public_html), that means in your phpBB folder it will break because all the requests are being made as if wordpress was in the phpBB. You can pretty much merge all the other htaccess to the one in the root folder, it's just a headache to maintain, plus if it gives you errors in the future remember that it's a bit of a hierarchy. (first execute this directives, then that, then this, etc etc)
Thanks for the help guys. Unfortunately i did delete one of the files, hopefully im no worse for wear for it.