Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Location
    San Luis Obispo, CA
    Posts
    38

    2 domain names, same site, different style sheets

    I'm looking for a way to create a web site with two different style sheets, each accessed from a different domain name.

    In other words, I want to create the same information but if you come in through domain A you get a different look than if you come in through domain B.

    I would prefer not to have to create two separate sites, because the info will change frequently. But I want people directed to domain A to see a different color, type style, other attributes, and different domain name from those who type in domain B.
    -------------
    www.consciencesites.com
    web design for nonprofits and small businesses

  2. #2
    That can be accomplished by pointing both domains to the same hosting account, then using PHP to check the variable $_SERVER['HTTP_HOST'] and returning the appropriate style sheet. For example:
    PHP Code:
    <?php
    if ($_SERVER['HTTP_HOST'] == "www.domain1.com" || $_SERVER['HTTP_HOST'] == "domain1.com") echo "stylesheet1.css";
    else echo 
    "stylesheet2.css";
    ?>

  3. #3
    Join Date
    Mar 2003
    Location
    San Luis Obispo, CA
    Posts
    38
    Worth a shot! I have used php but not created it. I'll give it a try. Thanks!
    -------------
    www.consciencesites.com
    web design for nonprofits and small businesses

  4. #4
    Actually, this will help me too thanks Krang!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •