I’m using a single MODx install with
Subsites (multiple domains) to manage a main website plus a few related "promo" sites. It’s all working pretty much 100% but I need to restrict some of the "promo" domains to their "folder". For example, the way Subsites works is it lines a domain up with a document. So say for example the MODx install at "website.com" has a document with ID "2" and alias "promo" which I want to be the homepage of domain "promo.com". I do the appropriate settings and hey presto, "promo.com" is managed from the "website.com/manager" install. But the way that Subsites works (which is fine and flexible) means that "promo.com/manager" works too. What I’d like to do is using .htaccess, restrict access for the domain "promo.com" to "promo.com/promo/*" based paths (plus a couple of asset based paths such as "promo.com/assets/*"), and redirect back to the home page if say "promo.com/manager/" was tried.
So in a nutshell, I need some help with .htaccess and probably mod_rewrite rules to restrict directory based on domain used, and redirect otherwise. I don’t mind if the solution is "hard-coded" where I need to make separate rules for each domain as it’s only around 5 ATM. I’m sure a PHP solution would work too which is probably how Subsites works in the first place but I don’t want to go hacking around there so maybe a snippet would work too?