The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mutiple domains in one CMS

Discussion in 'General Discussion' started by astrawally, May 17, 2009.

  1. astrawally

    astrawally Registered

    Joined:
    May 17, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I'm a total noob so apologies up front :)

    I have a CMS installed at for example mydomain.com

    It puts out url's like so: mydomain.com/index.php?id=1

    I have purchased further domains and wish to add them on to a sequence of id's like above. So ideally id's 1-3 would show as mydomain.com, id's 4-6 would show as mynewdomain.com
    Maybe it's clearer like this:

    • mydomain.com/index.php?id=1
    • mydomain.com/index.php?id=2
    • mydomain.com/index.php?id=3

    then next 3 pages

    • mynewdomain.com/index.php?id=4
    • mynewdomain.com/index.php?id=5
    • mynewdomain.com/index.php?id=6

    Can anyone tell me if this is possible thru Cpanel?

    The ranges wouldn't need to change once implemented. Ooh, BTW I have friendly urls if that helps, set to an alias.html. The html suffix can be changed in the CMS and there is an option to enable paths for pages in parent & child relationship (in the example above both ranges have their own distinct parent page).

    Many thanks
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    There are two primary methods for having additional domains on an account:

    1. Parked Domains
    - These serve exactly the same content as the primary domain on the account.

    2. Addon Domains
    - These serve content from another directory on your account.

    Any particular reason you're doing ?id=1...?id=6 - is it just for web statistics purposes?
     
  3. SageBrian

    SageBrian Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    415
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    NY/CT (US)
    cPanel Access Level:
    Root Administrator
    the ?id=1 is simply the content id in the cms.

    I remember doing it once, but I don't remember exactly how, and the site has since changed so I can't look it up.

    If I find my notes on it, I'll let you know.
     
  4. SageBrian

    SageBrian Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    415
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    NY/CT (US)
    cPanel Access Level:
    Root Administrator
    found it on another site.
    Code:
    RewriteCond %{HTTP_HOST} ^www.new2domain\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^new2domain\.com$
    RewriteRule ^(.*)$ http://www.yourdomain.com/index.php?id=22 [R=301,L]
    
    At least that's a starting point... :)
     
  5. astrawally

    astrawally Registered

    Joined:
    May 17, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks SageBrian & DavidG,

    My first instinct was that the answer lay in the .htaccess file but I couldn't find clear guidance for it. If my current work-around proves inadequate I will give Brians suggestion a go. In the meantime I have come up with what you see below. If anyone can see a reason why I shouldn't be using this then please let me know.

    So! What I did was this:
    Made a php file for each page in my id range with just this in it
    PHP:
    <?php include("http://mydomain.com/index.php?id=27"); ?>
    then copied them and the folder with all site assets into the addon domain set up in cpanel (so relative links will work).

    PROS:
    1) It works (yay!)
    2) This will sound weird but the CMS only needs to fulfill the job of updating current pages (about 18 of them over all 3 sites). I don't need it to make new pages or manage my sites menus.

    CONS:
    1) Had to make a bunch of individual files, one for each page which kinda defeats the purpose of the CMS
    2) My CMS now can't really handle automatic page/menu creation as I am effectively mirroring the sites instead of masking the domains. See PRO number 2 for why this could be worse.
    3) I am a noob and am not sure I understand all the implications of what I've done, are these 1 line php pages secure? Will Google hate them? *sigh*, curse you steep learning curve!

    Anyway... thanks for the advice SageBrian.
     
  6. SageBrian

    SageBrian Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    415
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    NY/CT (US)
    cPanel Access Level:
    Root Administrator
    I'm guessing this is your setup:
    domain1.com you want to bring up page id=21 on MainSite.com
    domain2.com = page id=22
    domain5.com = page id=25

    So, are you creating add-on domains so domain1 is actually pointing to MainSite.com/domain1/ and putting the include in index.php?

    MainSite.com/domain1/index.php which would show content from MainSite.com/index?id=21

    I'm wondering if Goggle might see this as duplicate content, as it already see this content on MainSite.com? It gets tricky.

    Maybe the CMS has a Multi-site extension that handles this stuff better? I think Joomla has something like this.

    Brian
     
Loading...

Share This Page