On Mon, Dec 12, 2011 at 5:42 PM, Steve Swift <swi...@swiftys.org.uk> wrote: > I think you'll have to put it in the documentroot of all of your > virtualhosts. Since it would be so much easier to do this in the Apache > config, I'll assume that you cannot do this for some reason. > > Second best would be to create the file in one documentroot, then use hard > links to place it in all of the other documentroots. >
No, when Apache is instructed to read .htaccess files (from an appropriate AllowOverride section), it will walk up the directory tree until it reach a directory that has AllowOverride None, or it reaches the root. Therefore, if you have /srv/http/site1/htdocs and /srv/http/site2/htdocs, and you place a htaccess at /srv/http/.htaccess, and /srv/http/siteN/htdocs is allowed to have a htaccess file, then the following htaccess files will be attempted to be loaded: /srv/http/siteN/htdocs/.htaccess /srv/http/siteN/.htaccess /srv/http/.htaccess /srv/.htaccess '/' is normally marked 'AllowOverride None' in the base conf file, so that wouldn't normally be checked. As should be obvious, this is part of the reason why you are discouraged from using .htaccess, it vastly inflates the work that apache must do to serve a request. More info in the docs: http://httpd.apache.org/docs/2.2/howto/htaccess.html Cheers Tom --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org " from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org