By the sounds of it, your sub
subdomain maps to the same directory as the main domain and all other subdomains (www
and other
, etc.)
However, if all requests to the sub
subdomain are internally rewritten to the /sub
subdirectory then you can presumably just create another .htaccess
at /sub/.htaccess
in which you set DirectorySlash Off
- this then applies to all requests to the sub
subdomain. (Assuming you don't also access the same subdirectory via a different hostname. You can prevent this if you wish.)
The /sub/.htaccess
file is also where you would be implementing #3 in your requirements.
The root .htaccess
file simply rewrites all requests to the sub
subdomain to the /sub
subdirectory.
Aside: Since you are asking this question on ServerFault it is generally assumed that you have full control of the server. In which case it would be preferable to configure this sub
subdomain in its own vHost container that points directly to the /sub
subdirectory (or somewhere outside of the main domains directory tree ideally). In this case, you would not need to implement #2 of your requirements and you just set DirectorySlash Off
for the entire subdomain.