i've got a .htaccess file during my root directory (public_html/) that appears such as this: (XXX.XX.XX.XX means an IP)

RewriteCond %{HTTP_HOST} ^XXX.XX.XX.XX$ [NC]
RewriteRule ^(.*)$ http://www.justadomain.tld [R=301,L]

You will find also .htaccess files in subfolders und folders of subfolders, however i want this rewrite rule to operate in most sites all around the account whether there is available b .htaccess or otherwise, without copying this rule in every file. The guidelines within the existing .htaccess files should continue working.

Thanks ahead of time for the solutions!

You have to add the next line into each .htaccess in subfolders if you wish to have rewrite rules from parent .htaccess to become performed too:

RewriteOptions inherit

This forces the present configuration to inherit the configuration of parents. In per-virtual-server context, which means that the maps, conditions and rules from the primary server are inherited. In per-directory context which means that conditions and rules from the parent directory's .htaccess configuration are inherited.

Rules inherited in the parent scope are applied after rules specified by the kid scope.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions


Alternatively -- move your "global" rule(s) from .htaccess into VirtualHost context (that's only when you are able to edit server config files, obviously).