I’m looking through my server because I want to restrict access to some specific folders and i’ve noticed I have several .htaccess files. One is in the root, the directory before public_html, is that the root, or is public_html the root? And that file enables php5 as default. I then have a htaccess doing some url re-writing in the public_html folder, then I have another one in the wordpress directory.
Is there a need for them to be spread out?
Do I have one htaccess for each folder I want affected or does the htaccess affect a folder plus all of the sub directories?
Thanks
Edit: Also have another htaccess in my wordpress theme folder?
Apache has two ways of storing configuration options:
The central configuration (the .conf files) – when you change these, you need to restart the server.
.htaccessfiles whose settings apply only to its directory, and all child directories. Changing these does not require a server restartIf you’re on a dedicated server, you could theoretically migrate all
.htaccessfiles into the central configuration, but WordPress will write into a.htaccessfile when updating its permalink structure, so you’ll always have at least that.In my experience, keeping individual
.htaccessfiles is relatively practical in everyday maintenance work as long as they’re not too many. I would leave things as they are.