Raymond, if that's the case (above), is that something that could be put into a plugin? A mod rewrite could redirect, but MODx would still generate the links with that redundant alias path...
To clarify things, do you mean it like this
For example we have:
- I setup a directory (dir id = 2) under the root dir, and set an alias to be "subdomain".
- All the documents/folders listed under doc/dir id 2 will be the sub sites content.
- I setup "subdomain.domain.com" to mirrored "domain.com"
With the plugin given above by xwisdom, when the user called "subdomain.domain.com" in their url, it will return a different starting page with the "domain.com". Later after that, when you follow the relative link on "subdomain.domain.com", it will do the same thing as "domain.com", which means, "subdomain.domain.com/subdomain/home.html" will be the same as "domain.com/subdomain/home.html", except the one on subdomain.domain.com has a different config of start_page and error_page.
If you're looking for this kind of solution, the plugin is done, and it was listed on top of this post.
But what I'm looking for is the one that you stated, which is to removed the subdomain part, if they are accessing the page using "subdomain.domain.com". So instead of "subdomain.domain.com/subdomain/home.html", they will have "subdomain.domain.com/home.html", but if they use "domain.com", then it will be "domain.com/subdomain/home.html".
The solution that I come up with is using mod_rewrite, to rewrite the "subdomain.domain.com/home.html" into "domain.com/subdomain/home.html".
Hope that clear things up.
I know I'm not that good at explaining something, so pardon me, if it sounds confusing to some of you guys.
Sincerely,
Wendy Novianto