WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Multiple Domains, One Site (9 posts)

  1. DarkxPunk
    Member
    Posted 1 year ago #

    It should be simple, and I have read many posts with no results.

    I have multiple domains that post to the same directory on my server (where the wp is). The problem is all the links redirect to the main domain. I need it so the domain name does not change.

    Example: sitea.com siteb.ca sitec.info
    When I click a link in sitea.com it will go to sitea.com/newpage
    When I click a link in siteb.ca it will go to siteb.ca/newpage
    When I click a link in sitec.info it will go to sitec.info/newpage
    Rather than:
    When I click a link in sitea.com it will go to sitea.com/newpage
    When I click a link in siteb.ca or sitec.info it will still go to sitea.com/newpage

    I don't need the page to be different per domain, it needs to be all the same but keep the domain visited!

    Thanks.

  2. Paul Clark
    Member
    Posted 1 year ago #

    You would do this by placing the below code in wp-config.php

    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

    See Codex: Editing WP-Config.

    BIG WARNING: Making the change you are describing will significantly hurt your search engine rankings. WordPress forces a single domain because that's correct behavior for online content. If you set up many domains for one set of content, at the very least research setting up rel=canonical tags.

  3. cinghaman
    Member
    Posted 1 year ago #

    try using MU-Domain-mapping plugin

  4. Paul Clark
    Member
    Posted 1 year ago #

    The MU Domain Mapping plugin would not work in this situation, because @DarkxPunk is running a single site, not a network. MU Domain Mapping only allows configuration in the Network Admin, which does not exist in a single-site install.

  5. If @DarkxPunk isn't running a network, he's in the wrong subforum.

    And @pdclark's warning is not only correct, but super important. This is a BAD IDEA. You don't want to redirect and keep the old URL, you want to legitimately redirect.

  6. Paul Clark
    Member
    Posted 1 year ago #

    Good point @ipstenu. I had only ben looking at @DarkxPunk's wording, not the subforum. Either way, unless he jumps in with more info, he has three correct answers now, with the most important being "hey... don't do that." ;)

  7. John
    Member
    Posted 1 year ago #

    @pdclark, I think you should trademark "hey... don't do that." :) It is a powerful, necessary and repetitive response on forums. I like it better than "you're doing it wrong".

  8. John Peden
    Member
    Posted 1 year ago #

    I'm looking to do something pretty similar myself as I'm setting up WordPress for an enterprise whose naming standards dictate that the front-end have a different URL to the back end:

    ng.live.platform.organization.net - should serve wp-admin (or at least the site) over SSL-Akamai.

    http://www.organization.org.ng - should serve the non-encrypted site through Akamai.

    Any thoughts?

  9. jcpeden - You should make your own topic, but be aware, I don't know if anyone's done this.

Topic Closed

This topic has been closed to new replies.

About this Topic