It's sorta already doing that. If you want the "bank" homepage then
you have to go to site1.com/home or site2.com/home. I don't think the
Router is equipped for routing by hostname (could be wrong though).

If you absolutely have to have the 2 sites mixed together and have the
domains mirror each other, except at document root, then your best bet
would be to just use mod_rewrite and add a rule for document root.
Otherwise, you'll have to check the hostname in PagesController and
serve the correct homepage.

Personally, I would just use one domain, making the other domain a
redirect, and use prefix routing. For instance:

bank.com would be the active domain, with pages like:
bank.com/contact-us
bank.com/careers
bank.com/privacy
bank.com/corp would be the prefix for all the bancorp stuff, e.g.:
bank.com/corp/contact-us
bank.com/corp/careers
bank.com/corp/privacy

This is much more intuitive to the user, instead of having 2 domains
with similarly-named pages like:
site#.com/privacy
site#.com/privacy_policy
site#.com/contact-us
site#.com/contact_us

On Jun 4, 1:29 pm, GregFL2001 <gdelo...@mitcs.com> wrote:
> Hey everyone - We've got a bit of an odd configuration, and I was
> wondering if anyone had ideas on how we could fix this. We took over
> hosting of a website this past week that essentially is two sites in
> one, a bank site and it's parent corp site. The routes.php file is
> used to determine which 'site' you are on, essentially loading up
> various pages based on the path. Pretty straightforward.
>
> However, what I'm running into is that any root traffic
> (www.site1.com/orwww.site2.com/) gets redirected to the corp site
> because of the routes file. You can see how the routes.php file is set
> up here:
>
>  *
>  * first the bancorp...
>  */
>     Router::connect('/', array('controller' => 'pages', 'action' =>
> 'display', 'bancorphome'));
>         Router::connect('/gpb-in-the-news', array('controller' => 'pages',
> 'action' => 'display', 'bancorpnews'));
>         Router::connect('/board-of-directors', array('controller' =>
> 'pages', 'action' => 'display', 'bancorpofficers'));
>         Router::connect('/contact-us', array('controller' => 'pages',
> 'action' => 'display', 'bancorpcontact'));
>         Router::connect('/thank-you', array('controller' => 'pages',
> 'action' => 'display', 'bancorpthankyou'));
>         Router::connect('/faq', array('controller' => 'pages', 'action' =>
> 'display', 'bancorpfaq'));
>         Router::connect('/privacy', array('controller' => 'pages', 'action'
> => 'display', 'bancorpprivacy'));
>
> /**
>  * then the bank ...
>  */
>         Router::connect('/home', array('controller' => 'pages', 'action' =>
> 'display', 'bankhome'));
>         Router::connect('/our-proposed-bank', array('controller' => 'pages',
> 'action' => 'display', 'bankhome'));
>         Router::connect('/executive-team', array('controller' => 'pages',
> 'action' => 'display', 'bankexecutive'));
>         Router::connect('/board_of_directors', array('controller' =>
> 'pages', 'action' => 'display', 'bankboard'));
>         Router::connect('/take-a-tour', array('controller' => 'pages',
> 'action' => 'display', 'banktakeatour'));
>         Router::connect('/career-opportunities', array('controller' =>
> 'pages', 'action' => 'display', 'bankcareers'));
>         Router::connect('/contact_us', array('controller' => 'pages',
> 'action' => 'display', 'bankcontact'));
>         Router::connect('/thank_you', array('controller' => 'pages',
> 'action' => 'display', 'bankthankyou'));
>         Router::connect('/privacy_policy', array('controller' => 'pages',
> 'action' => 'display', 'bankprivacy'));
>
> /**
>
> So, any root path gets sent to the bancorp site. Is there any way to
> differentiate the two sites, so that maybe it looks for the url and
> redirects to the appropriate home page (aside from splitting the one
> site into two)?
>
> Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to