Well-Known Member
Sep 30, 2008

How can I permanently disable the forwarding of /webmail to cpanels webmail interface. I need to still keep webmail enabled but instead users will go to https://hostname:2096 instead. I need to disable this because I have a important (read: big account) client coming that uses their own webmail system and their employees access it at: which by nature redirects to cpanels webmail system.

I know that it is a ScriptAliasMatch in httpd.conf which is causing this. I have commented out that line, but the problem is that the config file rebuilds itself on updates, adding new vhosts and restarts. I need a more permanent solution.

I have read about some script I can run which will cause cpanel to preserve changes during updates, new account creation and restarts (etc.) -- but I cannot seem to locate it now and am worried this approach would have negative side-effects... e.g. when it comes time to delete an account that is part of the 'preserved'/'reference' config. I also know about using the includes, however, correct me if i am wrong, i cannot negate existing rules (like a ScriptAliasMatch) only add new ones.

Any information and possible solutions would be greatly appreciated.


Well-Known Member
Sep 30, 2008
Have a close look at your proxy settings at WHM > Tweak Settings > Domains.
And here if you're interested in doing this for just one domain instead, I think this would be helpful: InsideVHost < EasyApache3 < TWiki
Thanks for the fast feedback.

I have the option you are pointing to, in whm, enabled. But the tricky part is that they dont actually use a folder called webmail, the webmail application folder is actually but somewhere along the line they used an apache redirect of to redirect to this.

There website is huge and the codebase is very complex -- its been patched together hundreds of times. They want to keep the folder at /rdmail and still use an apache redirect to handle /webmail

However, it seems that even with the option to enable accounts to have their own /webmail folder override the cpanel /webmail proxy... it isnt working properly in this case (still being handled by cp proxy)... probably has something to do with the fact that its a redirect? I tried just creating an empty folder called webmail and it didnt seem to help.

I would try the other method you said about editing their apache configuration. I dont have the file structure it looks for in the documentation.
in /usr/local/apache/conf there is no 'userdata' directory. So I could just create an include file like this: /usr/local/apache/conf/userdata/ssl/2/flotech/ ??? Note: I did see a directory called "sites" that holds vhost data for some of my clients domain.

Also, if I did want to just remove, or override, the /webmail ScriptAliasMatch rule for the entire server (and not have /webmail do anything -- treat it normally) from httpd.conf (main configuration), is there any place (a specfic include file?)/way to do this (where it will retain the changes)?

Thanks for the reply.
Last edited:


Well-Known Member
May 20, 2003
cPanel Access Level
Root Administrator
You'll have to go over those docs for exact answers. I think it explains at the top of the page I've linked you to:

You will need to create and use the following file structures:
Have you checked the account itself for an htaccess file with a redirect that might be messing you up in what you want? If you're using the old cpanel proxy that was posted on the forums here long ago, part of that was an htaccess file in the account and creating subdomains, IIRC.

I have the option you are pointing to, in whm, enabled.
How about disabling it? Does that help?


cPanel Development
Staff member
Apr 7, 2006
cPanel Access Level
Root Administrator
1. Open /usr/local/cpanel/APACHE_CONFIG in your favorite editor

2. Find the lines that reference /webmail

3. Add the following to the beginning of each line that contains /webmail:

( Make certain there is a space after the final * )

4. Save your changes and exit the editor

5. Execute /scripts/check_cpanel_apache_aliases

The above will remove the /webmail redirect for the entire server.