• My company site has representatives that use sub-domains for their customers to access their site. So joeblow.mysite.com really goes to mysite.com/joeblow and the theme stays the same only some of their personal information is added to the site and shopping cart links are personalized.

    I just moved to wordpress and their information is populating correctly but I need their subdomain to show in the address bar. joeblow.mysite.com is what they were seeing before so I must make that shows up again. These reps are created automatically by my vendor as the people sign up and I cannot create any DNS records due to the number of people signing up and their need for the site to work as soon as they signup.

    Thanks in advance for your time!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter poohberry

    (@poohberry)

    I’m also using a 404.php file to make that happen.

    <?php

    $base_url = $_SERVER[‘SERVER_PROTOCOL’].’://’.$_SERVER[‘HTTP_HOST’];
    $valid_404_error_url = “/page-not-found”;
    $replicated_site_url = “/”;

    $username = “ReplicatedSite”;
    $password = “**********”;

    $xmlstring = “https://mysite.com/ReplicatedURLSearch.asp?un=$username&pw=$password&Replicated=&#8221;;

    $strReplicatedURLCandidate = substr($_SERVER[‘REQUEST_URI’], 1);

    if (strpos($strReplicatedURLCandidate, “.”) > 0 ||
    strpos($strReplicatedURLCandidate, “/”) > 0 ||
    strpos($strReplicatedURLCandidate, “\\”) > 0 ||
    strlen($strReplicatedURLCandidate) == 0) {

    header(“Location: $valid_404_error_url”);
    }
    else {
    $xmlstring .= $strReplicatedURLCandidate;
    }

    $handle = file_get_contents($xmlstring);

    // 1|RepDID|RepID|Name|Email|BillStreet1|BillStreet2|BillCity|BillState|BillPostalCode|Phone1|Phone3|PictureFileName|ReplicatedText

    $aData = explode(“|”,$handle);

    if ( count($aData) < 2 ) {

    header(“Location: $valid_404_error_url”);

    }
    else {

    setcookie(“DID”, $aData[1]);
    setcookie(“ID”, $aData[2]);
    setcookie(“Name”, $aData[3]);
    setcookie(“Email”, $aData[4]);
    setcookie(“BillStreet1”, $aData[5]);
    setcookie(“BillStreet2”, $aData[6]);
    setcookie(“BillCity”, $aData[7]);
    setcookie(“BillState”, $aData[8]);
    setcookie(“BillPostalCode”, $aData[9]);
    setcookie(“Phone1”, $aData[10]);
    setcookie(“Phone3”, $aData[11]);
    setcookie(“PictureFileName”, $aData[12]);
    setcookie(“ReplicatedText”, $aData[13]);
    setcookie(“Company”, $aData[14]);

    header(“Location: $replicated_site_url”);

    }

    Thread Starter poohberry

    (@poohberry)

    Im running WP 3.2.1 on appache with cpanel and mysql

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    If you’re using multisite, just make a site called joeblow and make sure you’re using subdomains.

    Then point joeblow.domain.com to the ROOT of your HTML where WP is installed. Done.

    If you’ve got WP on a server besides domain.com, then you need to map the domain.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘keep subdomain in address bar’ is closed to new replies.