How make a fake sub-domain?

Discussion in 'PHP' started by waltercool, Sep 15, 2006.

  1. #1
    Hi there

    I have a hosting with a registed domain...

    But i have another hosting with a free domain.

    I need link the domains..., for ex. if domain is www.slash.cl, i need use www.slash.cl/addon for the another server.

    And display in direction bar www.slash.cl/addon and not the free domain direction.

    In other words.

    If i make an redirection for asdf.freehost.com, i want put www.slash.cl/addon and redirect to asdf.freegost.com, and displaying www.slash.cl/addon.

    Many thanks
     
    waltercool, Sep 15, 2006 IP
  2. jacksmith

    jacksmith Peon

    Messages:
    1,013
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I wish to help but I am afraid I find it little difficult to understand, please try rephrashing it. Also explain what do you mean by "free domain", is it something we get on say blogger.com?
     
    jacksmith, Sep 15, 2006 IP
  3. tangtang

    tangtang Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can try a Header redirect.
    e.g.
    Header("Location: http://asdf.freegost.com");
     
    tangtang, Sep 17, 2006 IP
  4. Borghunter

    Borghunter Well-Known Member

    Messages:
    212
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #4
    I believe waltercool wants the url not to be asdf.freegost.com. So I would just use a frame, I can't think of anything else you could do.
     
    Borghunter, Sep 17, 2006 IP
  5. waltercool

    waltercool Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    MMM... is not a frame, is like the free domains (like something.tk, but something.domain.com)

    Well

    I need make something with

    Header("Location: http://asdf.freegost.com");

    Because when i use that... the direction bar change to original website

    Look this images:

    I put a direction

    With Header("Location: http://asdf.freegost.com");

    http://img223.imageshack.us/img223/2462/originaltx4.jpg
    Code (markup):
    And this happen

    http://img72.imageshack.us/img72/2609/siguientent9.jpg
    Code (markup):
    I need:

    http://img72.imageshack.us/img72/9869/necesitojz8.jpg
    Code (markup):
    A image can say more of millions of words xD
     
    waltercool, Sep 18, 2006 IP
  6. Zeras

    Zeras Guest

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You could do it with a frame but then the URL would never change but at least the primary domain would show instead of where the site/content is really hosted.

    You could also use a proxy-server to do it but that is much more complicated.

    You could use a proxy-server routines that would serve the request on the main site by retrieving it via curl (or whatever) within the program and then displaying it but that would add extra overhead to the primary server. Basically, it would function like these turn-key proxy sites you see everywhere on the net.

    Another option you could try is using apache mod_rewrite. If you have the access, you can set up silent redirects where it redirects the user but doesn't change the URL in the address bar. If you do this, you'll have to make sure that the other site uses complete URL's with the primary domain in them. In other words, you can't just use "/whatever/test.html" in the links.

    -Zeras
     
    Zeras, Sep 19, 2006 IP
  7. waltercool

    waltercool Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    And...

    How the free domains can make that??

    Like .tk, .biz, .cc, etc,etc....+
     
    waltercool, Sep 22, 2006 IP
  8. thuonghieu

    thuonghieu Peon

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    1. If asdf.freegost.com you buy and have a dedicated IP (dedicated IP meaning: if you visit _http://xxx.xxx.xxx.xxx it browse to _http://asdf.freegost.com
    You can login into your domain control panel and setup like a dns: ns1.slash.cl or any_name_you_like.slash.cl
    OK, it is like a subdomain but really a dns.
    2. Not dedicated IP: Set frame in _http://.slash.cl/addon/index.html
    I am sure you are success
     
    thuonghieu, Sep 22, 2006 IP
  9. amnezia

    amnezia Peon

    Messages:
    990
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #9
    what you are reffering to is url cloaking

    you need to use mod_rewrite in .htaccess

    the mod_rewrite rule would be:

    RewriteRule ^slash\.cl/addon$ asdf.freehost.com
     
    amnezia, Sep 22, 2006 IP
  10. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #10
    That is possible using wildcard DNS combining with mod rewrite. But need little work and you should have access to your internal server files or you may request your host do it for you if you don't have.

    If you're using a cpanel base server, visit http://www.tips1001.com/2006/07/29/wildcard-dns.html how to do this.
     
    PinoyIto, Sep 22, 2006 IP