Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9151659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:51:23+00:00 2026-06-17T11:51:23+00:00

First, let me explain my situation: I have two domains, two websites, the same

  • 0

First, let me explain my situation:
I have two domains, two websites, the same layout, but different content and different purposes.
What I would like to do:

Share between these two systems:

  • The functionality, layout template and management.

What is different:

  • The pages in the view, some controllers.

The options I considered:

Option 1

  1. Make one of the two sites a plugin
  2. Check the hostname: $_SERVER[‘HTTP_HOST’], and indicate in the core or bootstrap if the plugin should be used or not.

Something like this:

if ($_SERVER['HTTP_HOST'] == 'www.example1.com') {
    Configure::write('defaultplugin', 'example1');
} else {
    Configure::write('defaultplugin', null);
}

Is this possible

Option 2

A virtual address, but this is also hard to achieve because my routing is configured like this:

Router::connect("/{$prefix}/:language/:plugin", $indexParams, $shortParams);

Maybe I should change this route to:

Router::connect("/{$prefix}/:plugin/:language", $indexParams, $shortParams);

But if my earlier suggestion is possible, I would like to that, because I don’t know if the last solution will work correctly on some levels.

Option 3

Use the method described here: http://rickguyer.com/cakephp-one-core-many-apps/

So I would make 3 app folders: example1, example2, common. But I don’t know if it is possible to have the app folder consist of the contents of example1 and common OR example2 and common.

Option 4

An awesome idea from someone here on Stackoverflow.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:51:24+00:00Added an answer on June 17, 2026 at 11:51 am

    We switch our routes.php content based on the domain.
    This way we have all the flexibility without having to do too much config/hacking/switching.

    You just switch/replace the relevant routes and the rest should be fine.

    e.g.:

    if ($isDomainX) {
        Router::connect('/', array('plugin' => 'shop', 'controller' => 'shop', 'action' => 'index', 'slug' => $slug), array('pass' => array('slug')));
        ...
    } else {
         Router::connect('/', array('controller' => 'custom_pages', 'action' => 'homepage'));
        ...
    }
    

    You could also include/switch a whole file, if that makes it easier to read/maintain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me explain the situation I have two tables: -One is to store the
First things first, let me explain my situation: I'm working on a client and
First let me explain. I have several addresses on the page that I put
Let me first explain what's I'm trying to do. So I have a entity
It might sound unnecessary, but let me explain my problem first. Probably then it
We have a very odd problem here with SVN. Let me first explain the
First let me explain that I have this script that should let users enter
Let me explain my scenario first: I have around 2000 tests to run, which
This might seem phrased oddly at first, but let me explain through example. Note
Hi everyone let me explain this issue: Background: I have two web applications The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.