Served by Apache I'd like on one subdomain site of mine (say sub.mydomain.com
) that URLs without trailing slashes point directly (without external redirect) to the index file in the underlying folder. The subdomain requests are internally redirected to a sub-folder. All other URLS should work in the normal Apache way with external redirect to the slashed version.
All the directives have to go in my .htaccess file. For this to work I am planning to do the following:
- Switch off
DirectorySlash
for requests tosub.mydomain.com/...
- Rewrite the
sub.mydomain.com/…
requests to/sub/...
- Rewrite slashless directory URLs with
/sub/...
to fetch theindex.html
inside the underlying directory
I have a good idea how to do 2. and 3., but how can I issue DirectorySlash off
only for requests to sub.mydomain.com
, but not to www.mydomain.com
or other.mydomain.com
?