redirect subdomain to a website

Discussion in 'HTML & Website Design' started by exclink, Mar 23, 2010.

  1. #1
    dear member

    i have a question

    let see ex i have a domain xxxx.com

    and i create a subdomain aaa.xxxx.com


    i want to know how can i redirect this new subdomain "aaa.xxxx.com" to google ex

    but in url address in browser still aaa.xxxx.com

    so there is any html or php code ?


    thnx in advance
     
    exclink, Mar 23, 2010 IP
  2. HellBomb

    HellBomb Active Member

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Their are a couple different ways to do this. One way is using .htaccess redirect which is the simpilest a good tutorial can be found here.
    javascriptkit.com/howto/htaccess7.shtml

    and then their is the classic html way found here.
    instant-web-site-tools.com/html-redirect.html

    I hope this helps, also renember their is always Google :)
     
    HellBomb, Mar 23, 2010 IP
  3. canadianguy_001

    canadianguy_001 Peon

    Messages:
    97
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes .htaccess is the cleanest way to do it. Or if you are using cpanel for your hosting you could also set up subdomain redirection.

    Finally you could also do it using php with a header redirect:

    <?php

    header( 'Location: http://www.yoursite.com/' ) ;

    ?>
     
    canadianguy_001, Mar 23, 2010 IP
  4. tswartz

    tswartz Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you want to keep the original subdomain URL, an iframe could work too.
     
    tswartz, Mar 23, 2010 IP