The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cname url redirect

Discussion in 'General Discussion' started by Aquitaine, Mar 10, 2005.

  1. Aquitaine

    Aquitaine Member

    Joined:
    May 7, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Calcutta
    Hi all
    I need some help with cname redirects.

    i want to redirect a subdomain like a.b.com to yahoo.com/some/page.html.

    while looking like it was still at a.b.com

    I can redirect to domains like yahoo.com but not pages on the site.

    Anyone have an idea ?

    Thanks

    Aquitaine
     
  2. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    Hello,

    You don't really want to be using CNAME's for that purpose.

    Here is an example of when a CNAME can be used

    You have xyz.com hosted on your box and its dns is hosted elsewhere (Say zoneedit.com hosts the dns)

    You can make an A records to point to the IP on your server for xyz.com

    Now if the IP of xyz.com changes, you have no control over the dns, so it would be up to the client to change the IP at zoneedit.com - potentially the site would be offline.

    You can use a CNAME in this example as follows.

    Instead of adding A records pointing to your server IP, assuming the account is using the same IP (shared IP) that the server hostname uses, they could use a CNAME for www.xyz.com to point to your.server.com - that way if the IP changes, no changes need to be made by clients who use 3rd party dns.

    You could setup a subdomain and place an index.php file with a redirect header , to point to the page on yahoo that you wanted to, or use .htaccess

    PHP header redirect

    <?php header("Location: http://www.yahoo.com/page.html");
    ?>

    You could use .htaccess or a META tag within the index page of the sub dir too.

    If you want the browser to show your address, then you need to create a page that uses frames, to load a the top portion (frame) on your server, and the lower frame loads the remote URL.
     
  3. Aquitaine

    Aquitaine Member

    Joined:
    May 7, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Calcutta
    what im trying to do

    hey digitaln thanks for the reply,
    i managed to figure that part out for myself, but what im trying to do is have an affiliate script installed at say abc.com and use affiliate.xyz.com look like its abc.com

    Now if i was just dealing with a domain name it wouldve worked fine, but the problem is that the url is like
    abc.com/affiliate/page.html

    So a 0 frame would work best, but i dont know if cookies would get set and it might ruin the whole purpose of the affiliate program if it tracks via cookies which im sure it does.


    Anyone else have any ideas on how this sort of thing could be setup ?

    Thanks

    Aquitaine
     
  4. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    I suppose it would depend upon which affiliate script you are using - try a frames page and test it out or ask the affiliate script provider what they recommend or other users of it, to see what they do.
     
Loading...

Share This Page