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.

Folder for any incoming domain

Discussion in 'General Discussion' started by soathiam, May 28, 2014.

  1. soathiam

    soathiam Registered

    Joined:
    May 28, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi guys,

    I would like to know if it is possible to have a default folder that is accessed everytimr an unknown domain accesses the server.
    For example, if abc.com has its DNS set to point at my server's IP, how do I tell cPanel to redirect it to myFolder/mySubFolder withut having to set it in addon dmains. So any domain that would get to my server would access the same folder.

    I thought about using wildcards, but it seems to be only available for subdomains.

    Thank you for your help.

    Swat
     
  2. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Perhaps I may not be clear with your requirements but what I understood here that you need to redirect incoming request to your domain to specific folder. A redirect rule here can play trick to satisfy your requirements.
    For more details refer to mod_rewrite - Apache HTTP Server Version 2.4
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    By default, visitors to domain names pointed to your servers without VirtualHost entries are directed to the default website page. You could directly edit the default website page via:

    "WHM Home » Account Functions » Web Template Editor"

    Thank you.
     
  4. soathiam

    soathiam Registered

    Joined:
    May 28, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you for your answers.
    cPanelMichael - I really need to control the folder because my application delivers content based on the incoming domain. What I would like is for anyone to just DNS point to my server and my app will do the rest.

    storminternet - I will look into mod_rewrite and see if it is the answer to my dilema :)

    Any suggestion is welcome,
    Thanks
    Swat
     
  5. soathiam

    soathiam Registered

    Joined:
    May 28, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I might be reading it wrong but it seems that mod_rewrite needs the domain name (url). I don't know the domain in advance, the users just specify it in their profile so it is dynamic.

    - - - Updated - - -

    Hi,
    Thank you for your answers, it looks like the system erased my previous reply.

    As per my previous post, it looks like mod_rewrite is not the solution.
    Also, I can't use the default web page, I need to get the any domain to my folder as my application delivers content based on domain name.
    The domains are dynamic and user have the ability to change them.

    My other option is to set up an automated addon domain creator that uses cPanel's API but I wanted to avoid messing with addon domains as after a while it will be very hard to manage.

    Any suggestion is welcome,

    Thank you
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You could setup the default website page to redirect to a location/website of your choosing, but keep in mind it's presented to more than just domain names not configured in Apache.

    Thank you.
     
Loading...

Share This Page