is it possible to access one script using two domains?

Discussion in 'Domain Names' started by dscurlock, Jun 11, 2008.

  1. #1
    I would like to use one script, and domain domains...

    IE:

    www.domain1.com/script.php

    and if i want to run the same script with

    www.domain2.com/script.php

    is this possible? forwarding will not work as domain2.com would just
    be forwarded to domain1.com. parking domain2.com on domain1.com does not seem to work, when I try domain2.com/script.php it just redirets to domain1.com and does not load the script...

    I am thinking about starting a business using two appropriate domains, and would like to access just one script, and not having two complete domain sites...

    Thank-You
     
    dscurlock, Jun 11, 2008 IP
  2. csi

    csi Guest

    Messages:
    265
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This really belongs in like the programming forum or something... but yes, I think you can. They would probably need to be hosted on the one computer and use the one database.
     
    csi, Jun 11, 2008 IP
  3. welkin

    welkin Active Member

    Messages:
    521
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #3
    One possible way is to use url forwarding and masking. This way in the browser's address bar will stay domain2.com

    But I'm not sure that using two domain names is a good idea. I would rather use a forwarding without masking in order to make the users familiar with one of the names and make it more "powerful".
     
    welkin, Jun 12, 2008 IP
  4. dscurlock

    dscurlock Prominent Member

    Messages:
    4,564
    Likes Received:
    260
    Best Answers:
    0
    Trophy Points:
    300
    #4
    I am trying to give the user and option to use the domain he/she
    might like best...
     
    dscurlock, Jun 12, 2008 IP
  5. evil

    evil Well-Known Member

    Messages:
    588
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    108
    #5
    The simple way is to check your script and don't use absolute url like domain1.com.
    If you need the domain name, you can use $_SERVER['REQUEST_URI'] in php.
    Then Parking domain2.com on domain1.com for example with Cpanel
     
    evil, Jun 12, 2008 IP
  6. Directive

    Directive Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    are you talking about server load balancing?
     
    Directive, Jun 12, 2008 IP