Just to be sure, I should be able to put another .htaccess in a subdirectory and expect it to rewrite the urls for example.com/sub, right?
Yes. The mod_rewrite directives in the /subdir/.htaccess file will, by default, completely override the mod_rewrite directives in the parent/root .htaccess file. However, you will need to redefine the ErrorDocument directives in order to override the root.
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
To clarify, with these two conditions are you wanting to occasionally serve the index.html or index.php (DirectoryIndex) document from a requested subdirectory, instead of routing the request to /index.php in the document root? In this case it would be more common (and marginally more optimal) to simply check that the request does not map to a directory instead (ie. RewriteCond %{REQUEST_FILENAME} !-d). Unless there are some physical subdirectories that you want to route to /index.php in the document root?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
These directives could be simplified slightly - and this will help you if you want to apply the same directives to the subsite in /subdir (and serve /subdir/index.php instead).
Remove the RewriteBase directive entirely. The relative susbtitution string, ie. index.php, will then be relative to the directory where the .htaccess file is located (or inherited).
You also don't need the <IfModule mod_rewrite.c> wrapper. See my answer to the following question on the Webmasters Stack for more information on this: https://webmasters.stackexchange.com/questions/112600/is-checking-for-mod-write-really-necessary
So, the above can be written:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
(And note my comment above about replacing the two conditions with a directory check instead.)
Now, you could simply copy the exact same directives into the /subdir/.htaccess file and these will now route requests to /subdir/index.php instead, overriding the mod_rewrite directives in the parent.
No need to copy Options -Indexes, unless you want to change this option.
OR, if you want to apply the exact same directives (but in relation to the /subdir) you could simply enable mod_rewrite inheritance in the /subdir/.htaccess file. For example:
# /subdir/.htaccess
ErrorDocument 403 /subdir/404.php
ErrorDocument 404 /subdir/404.php
RewriteEngine On
RewriteOptions Inherit
The effect of RewriteOptions Inherit is to essentially "copy" the mod_rewrite directives from the parent config, ie. /.htaccess in the root, behind the directives in the current /subdir/.htaccess file. It is important to clarify that the directives are "copied", they are not run in-place as if in the root /.htaccess file.