I have tried to find the answer for almost a year now, and did ask on several different forums.
My directory structure:
/public_html/
/public_html/admin/
/public_html/domains/domain1/
/public_html/domains/domain1/admin/
/public_html/domains/domain2/
/public_html/domains/domain2/admin/
My main website is in the root /public_html/ and it's admin module is in /public_html/admin/
With RewriteCond and RewriteRule I redirect some other domains to different directories.
However, when I try to access www.domain1.nl/admin/ it will first check if there is an admin directory in the root. Because there is, it will load the wrong admin page.
I want a RewriteCond where i redirect a domainname to a different folder and always stays in that folder and not look in the root first. Is this possible?
RewriteCond %{HTTP_HOST} ^(www\.)?[a-z0-9]+\.domain1\.nl$ [NC]
RewriteCond %{REQUEST_URI} !^/domains/domain1/
RewriteRule (.*) /domains/domain1/$1