Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Wildcard DNS for URL Redirection script

Discussion in 'Bind/DNS/Nameserver' started by isputra, Dec 15, 2005.

  1. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Mbelitar
    Hi,

    I already search on this forum and meet dgbaker on other thread but still can't find the answer of my problem.

    I have a client that want to use url redirection script. This script required wildcard dns.

    My client account attach to shared IP so to give him wildcard dns, i must edit httpd.conf and add *.domain.com to ServerAlias and restart apache.

    This situation is not what i want, because restarting apache i will not do it unless when apache crash.

    So, can I :
    1. Give him wildcard dns without edit httpd.conf
    2. Client can add this wildcard thing if he need it by himself (maybe through WHM).

    Remember, this client use shared IP for his account. Search on google and find some mod rewrite rule but all failed.

    Is this possible to do ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. simplestar

    simplestar Well-Known Member

    Joined:
    Nov 15, 2005
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    156
    There's an option in frontend cPanel to forward or, if it's not there, you can add the feature. I know it can be done via .htaccess also. I agree on not making that change in httpd.
     
  3. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,664
    Likes Received:
    69
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    DNS yes it can be granted via WHM
    cant be done


    as far as your redirection not sure what you want to redirect to file folder new domain but

    first create an add on doamin in the cpanel's account anything.domain.com in my example i just used folder. Edit the text in red in the virtual host container . now your client can redirect his wild card subdomains where ever he/she wants using .htaccess :)




    <VirtualHost xxx.xx.xxx.xxx>
    ServerAlias www.folder.domain.com *.domain.com
    ServerAdmin webmaster@folder.domain.com
    DocumentRoot /home/username/public_html/folder
    BytesLog domlogs/folder.domain.com-bytes_log
    ServerName folder.domain.com
    ServerAlias folder.domain.com www.folder.domain.com
    UseCanonicalName off

    User username
    Group username
    CustomLog /usr/local/apache/domlogs/folder.domain.com combined
    ScriptAlias /cgi-bin/ /home/username/public_html/folder/cgi-bin/
    </VirtualHost>


    then
    and add this to .htaccess to the adon domain folder
    RedirectMatch permanent ^(.*)$ http://www.redirectdomain.com
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #3 dalem, Dec 15, 2005
    Last edited: Dec 15, 2005
  4. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Mbelitar
    Hi dalem,

    I think on my first post already mention that i know how to give wildcard dns using *.domain.com at httpd.conf :

    After read more thread on other forum that i found when search from google, i think that not possible to do it without editing httpd.conf
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,664
    Likes Received:
    69
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    confused :confused:
    what do you mean by this ????

    what do you think happens everytime you add a domain via whm or one of your clients adds a subdomain?

    apache restarts
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 dalem, Dec 15, 2005
    Last edited: Dec 15, 2005
  6. simplestar

    simplestar Well-Known Member

    Joined:
    Nov 15, 2005
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    156
    I think even adding Wildcard DNS would be more of a concern than restarting Apache.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice