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

orty

Well-Known Member
Jun 29, 2004
109
0
166
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
 

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
Have you tried directly with sub domain URL redirection feature available in cPanel?

Hope it will help.
 

orty

Well-Known Member
Jun 29, 2004
109
0
166
Bend, Oregon
cPanel Access Level
Root Administrator
Have you tried directly with sub domain URL redirection feature available in cPanel?

Hope it will help.
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.