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.

Pointing domain2.com to sub.domain1.com

Discussion in 'General Discussion' started by okihost, May 24, 2003.

  1. okihost

    okihost Registered

    Joined:
    Mar 31, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I have a customer who has setup a subdomain which is sub.domain.com he wants domain2.com to point to that subdomain. I have tried EVERYTHING I could think of and all posts here and have not figured it out yet.. Here is what I have the httpd.conf set like now for the subdomain tag.

    <VirtualHost MY IP>
    BytesLog domlogs/sub.domain.com-bytes_log
    User admin1
    Group admin1
    ServerName domain2.org
    ServerAlias sub.domain.com *.domain.com
    ServerAdmin wwwadmin@domain.com
    DocumentRoot /home/comprel/public_html/sub
    CustomLog domlogs/sub.domain.com combined
    ScriptAlias /cgi-bin/ /home/admin1/public_html/sub/cgi-bin/
    User admin1
    Group admin1
    </VirtualHost>

    I have even tried adding an A record for domain2.com in the zone file and nothing seems to work. It looks like it has happened to people before, but none of those fixes have worked for me yet. Thanks in advance.

    cPanel.net Support Ticket Number:
     
  2. mitul

    mitul Well-Known Member

    Joined:
    Feb 8, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    16
    You can write a simple php script with 'header location' to point all the request comming to the domain to that sumdomain.

    cPanel.net Support Ticket Number:
     
  3. steve248

    steve248 Member

    Joined:
    Apr 11, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I would also love to be able to do this, I have no idea how to write this simple PHP script though, anyone any ideas?

    cPanel.net Support Ticket Number:
     
  4. NNNils

    NNNils Well-Known Member

    Joined:
    Sep 17, 2002
    Messages:
    580
    Likes Received:
    0
    Trophy Points:
    16
    Why not edit his .htaccess file to forward to it?

    cPanel.net Support Ticket Number:
     
  5. vishal

    vishal Well-Known Member

    Joined:
    Jan 28, 2003
    Messages:
    340
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Use a PHP Script with header:

    pico index.php

    <? header("Location:sub/index.php"); ?>
    Save and Exit.

    Hope this helps!

    Regars,

    cPanel.net Support Ticket Number:
     
  6. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    Have you tried using the 'Add-on Doman' feature in Cpanel? This is exactly what it was designed for.

    If 'domain2.com' is a properly registered Domain name, then there is no problem.

    cPanel.net Support Ticket Number:
     
  7. cjbyron

    cjbyron Member

    Joined:
    Jun 30, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Create a index.html file to put in the 1st domain that you want forwarded.

    In that index file place:

    <FRAMESET ROWS="*,0" FRAMEBORDER=0 BORDER=0 FRAMESPACING=0>
    <FRAME SRC="http://domain2.com/" NORESIZE>
    </FRAMESET>

    with domain2 being where you want it to go to.

    The above code should be placed in the "head" section of the html doc.

    Plesk does this all for you, but not C-Panel. :(

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page