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.

How to redirect UNEXISTING subdomains?

Discussion in 'General Discussion' started by cricu, Feb 3, 2008.

  1. cricu

    cricu Registered

    Joined:
    Feb 3, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I have a cpanel account at my hosting provider and everything I write as a subdomain for MY DOMAIN NAME, goes straight to my hosting provider's website. How can I fix this problem?

    Example:
    - my domain name is: WWW.MYDOMAIN.COM
    - i have a subdomain: PROFILE.MYDOMAIN.COM
    - host domain name is WWW.HOSTINGSERVICES.COM

    - when I request PROFILE.MYDOMAIN.COM, it works neat, BUT
    - when I request ANYFAKESUBDOMAIN.MYDOMAIN.COM, it goes to WWW.HOSTINGSERVICES.COM

    I want to change this and I can't find a solution. :confused:

    Thank you!
     
  2. johnmigen

    johnmigen Active Member

    Joined:
    Jan 19, 2008
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    If you have root access,

    What you can do is at the apache Post Virtual Host Include , write a catch all and point all unfound site to serve from default location.

    <VirtualHost 123.123.123.123:80>
    ServerName *
    ServerAlias *
    ServerAdmin support@domain.com
    DocumentRoot /home/username/public_html
    </VirtualHost>
     
  3. cricu

    cricu Registered

    Joined:
    Feb 3, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, but no, I don't have root access :(
     
  4. johnmigen

    johnmigen Active Member

    Joined:
    Jan 19, 2008
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    If you don't have root access, there is no way you can change where your users will go.

    Another alternative is you buy a dedicated IP from your reseller provider and then place your account as the main account with dedicated IP, and then create all your accounts under that IP.

    Write a htaccess script to redirect all undefined pages to null.
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Depending upon your cPanel version[1], you can create a wild card subdomain. IN your cPanel interface, click Subdomains and enter * in the Subdomain field. You might also request that your webhost provider add such a subdomain for you.


    [1] This functionality is currently broken in at least the latest Current and EDGE builds.
     
Loading...

Share This Page