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.

Domain to webpage redirect

Discussion in 'General Discussion' started by tzvish, Jan 18, 2012.

  1. tzvish

    tzvish Registered

    Joined:
    Jan 18, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi great people,

    My website creates a page for each user,
    e.g website.com/site/44 (44 is the user ID)

    My users want their newly bought domain to show that page.

    Is there a way that anyone who sets my nameservers (ns1.website.com) and doesn't have a cpanel account setup on my server gets directed to a webpage on my website.com website?

    (I plan to then redirect them based on the source domain to their user profile)

    Thanks,
     
  2. tzvish

    tzvish Registered

    Joined:
    Jan 18, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    So I've done some research to this,

    The best way to do it is to use the "park a domain" feature in CPanel.

    Domain parking can be done automatically by my php code with the include of xmlapi-php / xmlapi.php

    After asking the user for his domain name and telling him to add the ns1 and ns2 to his DNS Registar

    I then need to read from PHP the domain name and serve user content accordingly.

    I hope this helps someone else.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Thank you for updating us on how you were able to achieve this. For any other users who may want to configure a similar setup, the following documentation should be useful:

    Park Module Documentation

    XMLAPI PHP Client Class

    Thank you.
     
Loading...

Share This Page