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.

Can't Override Users /webmail -- probably simple fix

Discussion in 'E-mail Discussions' started by orty, Apr 15, 2012.

  1. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Hello there,

    I have a user on this server that I want to redirect www.domain.com/webmail to a completely different site (http://mail.google.com/a/domain.com). I setup a subdomain for the user in cpanel for webmail.domain.com, pointed the subdomain setup to the /home/user/public_html/webmail directory, and inside that directory, put a very simple index.php that contains this:

    PHP:
    <?php 
    header
    ("Location: http://mail.google.com/a/domain.com"); 
    exit(); 
    ?> 
    When loading webmail.domain.com, it redirects properly, but www.domain.com/webmail/ still loads the cPanel webmail login. The users for that particular domain mostly have www.domain.com/webmail bookmarked, and they don't like to change habits ;-).

    A long while ago (the Apache 1.x days, I'm running 2.x now), I overrode the /webmail for this user via an httpd.conf include (webmail.conf). I've emptied out that include file, but something's still getting overridden/cached and I cannot figure out where. Any ideas where?

    -Jake
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Have you tried directly with sub domain URL redirection feature available in cPanel?

    Hope it will help.
     
  3. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Yeah, but that didn't help. It would only redirect the subdomain, but not the /webmail.

    After filing a ticket with cPanel, here's what we had to do make this work. I already had a webmail.conf that was getting included (though it was blank) in httpd.conf for that particular user (/usr/local/apache/conf/userdata/std/2/user/domain.com). Added a "Alias /webmail /home/user/public_html/webmail" to that file, restarted apache, and things are working fine now, as it's pulling that index.php file and redirecting properly. So the built-in subdomain stuff in cPanel will work on the subdomain, but that's the only way to get the folder away from the system-wide default.
     
Loading...

Share This Page