Thanks for the input. OK ... I have been doing some testing to see how this would work in my situation.
Why not install modx 4 times? Each modx on its own url using the same database?
Then use 4 diff templates each containing the menu routine with the proper page_id ?
First of all, I need to use the same database with the same prefix ( xxx_ ) so I can have all the webusers access any of the sites. This is also important in making the business directory and images available to all sites.
What I would however suggest is that you create plugin that listens to the OnManagerLogin to execute your code. This will however only work once after login
I also needed to have the correct site called up by URL when visitors went to the site ... not just when someone logged in.
The resolution I finally got to work was so simple ... it helps to get some sleep (and have help from above). As I had mentioned before, I have multiple sites created in the same prefixed-database. The documents for the home pages are IDs 10, 15, & 20. The main site_start document ID is 1.
All I had to do was modify the above code to:
<?php
$MYURL = $_SERVER[’SERVER_NAME’];
if (ereg(’myfirsturl’,$MYURL))
? {
? ?// this watches for www.myfirsturl.com or myfirsturl.com
? ?header(’Location: index.php?id=10’);
? }
elseif (ereg(’mysecondurl’,$MYURL))
? {
? ?// this watches for www.mysecondurl.com or mysecondurl.com
? ?header(’Location: index.php?id=15’);
? }
elseif (ereg(’mythirdurl’,$MYURL))
? {
? ?// this watches for www.mythirdurl.com or mythirdurl.com
? ?header(’Location: index.php?id=20’);
? }
?>
put it in a snippet and call the snippet in the site_start page (id=1).
This appears to be working ok. One concern I have (and I’m not sure if it should be a big concern) is how do I keep a visitor from calling up a published document under one of the other URLs by just manually typing in id=xx at the end of the line?
For instance:
id=10 is the home page for www.myfirsturl.com. IDs 11, 12, 13, 14 are other published documents under ID 10. What is to prevent someone from visiting through URL www.mythirdurl.com (id=20) and then just changing the id=20 to id=12 which would take them to different content.
I assume this would be a problem on any Etomite or Modx site. If anyone has ideas on how to avoid this, please share them.
Thanks again for all who helped.
Dennis