This is by the way in the following specific example pretty useful (and I'm in need for a solution to this example..!)
domain.com has a website using TYPO3 (
www.typo3.com) and it's RealURL-extension. If you have no idea what that means, no problem.
For this combination it is necessary that the following is put into a .htaccess-file or into the httpd.conf for that specific domain:
Code:
RewriteEngine On
RewriteRule ^(typo3|typo3temp|typo3conf|t3lib|fileadmin|uploads|phpmyadmin|phpMyAdmin|horde)(/.*)?$ - [L]
RewriteRule ^(.*)$ /index.php [L,E=ORIG_SCRIPT_NAME:/index.php]
That is inside my /home/user/domains/domain.com/public_html/.htaccess file.
This does, in principle, the following: it redirects every single request to a file somewhere inside this folder (or many more levels deep) to /index.php.
Now I create a subdomain: sub.domain.com. This is located in /home/user/domains/domain.com/public_html/sub/ and every request to a page in sub.domain.com/ will request a page from this folder. Apache, smart-ass as it is, searches for a .htaccess-file within the rootline and finds one, one folder above the current one (the one with the redirects).
So Apache redirects every request to sub.domain.com/abcd/ef to sub.domain.com/index.php
And that's not what I want.
Only two possible solutions to this problem:
a) place the subdomains NOT in a subfolder of the main domain (so, for example, use /home/user/domains/domain.com/subdomains/sub/public_html), which would solve me a lot of trouble, but is probably impossible to work out (..?)
b) place the code in the .htaccess in the httpd.conf for the domain. Only problem is then that all the custom httpd configuration is also copied to the subdomains, and I
don't want it at the subdomains.
I hope this (maybe technical) story sounds a little bit logical.