Autodiscover.xml redirects


Sep 17, 2017
cPanel Access Level
Root Administrator
@cPanelMichael this may be a bug?

I could be wrong by the below, however;

It would be a requirement to be able to redirect the Autodiscover.xml elsewhere. The problem is that the built in configuration hierarchy will not allow you to specify a redirect because up the configuration chain in httpd.conf (as has already been pointed out) already contains:

grep ScriptAliasMatch /etc/apache2/conf/httpd.conf | grep -i auto
ScriptAliasMatch ^/Autodiscover/Autodiscover.xml /usr/local/cpanel/cgi-sys/autodiscover.cgi
ScriptAliasMatch ^/autodiscover/autodiscover.xml /usr/local/cpanel/cgi-sys/autodiscover.cgi
In addition to that, there appears to be no avenue to specify to autodiscover.cgi what to redirect to for each host or even on a global level, even if Remote Mail Exchange is configured for any particular vhost? This causes the CGI script to display a result and thereby also overrides any lower tier redirection - not sure if there's a way to override in htaccess for example?

If redirect is not available it may, in turn, cause all sorts of problems for IT when it is required that Autodiscover.xml be redirected elsewhere (not worth debating the possibilities, in short there may be no solid way to configure a redirect for Autodiscover.xml).

A possible (though limited) work around for the current version is to place the following, this is piece-mill and hard to maintain (for others to verify):

Home » Service Configuration » Apache Configuration » Include Editor » Pre VirtualHost Include

Place something similar to the below (dont forget to modify the bit):

CAUTION: THIS IS A GLOBAL CHANGE FOR ENTIRE SERVER IN THIS EXAMPLE, BE CAREFUL. This will change all autodiscover redirects for all configurations to ONE - although it can be further customised.

RedirectMatch (?i)/Autodiscover/Autodiscover.xml
SIDE NOTE: existing ScriptAliasMatch does not cover case-insensitive URL's either.

Again this isn't really a solution, however the problem may be far reaching, indicating that this is a bug - again I could be wrong, however this may already have been pointed out elsewhere I do not know, however I've searched as much as I can and I keep being returned to this thread.


Staff member
Apr 11, 2011
Hello @Edab,

Could you provide more information about the specific scenario you are attempting to solve through the use of a custom autodiscover redirect destination?

Thank you.