SOLVED Website in one server, mail in another

acpro

Member
Mar 7, 2017
11
2
3
Portugal
cPanel Access Level
Root Administrator
Hi.

I recently changed the website to one server, keeping the mail in the old server, so:

domain.com A IPNewServer
domain.com MX mail.domain.com
mail A IPOldServer
-----------------------------

webmail.domain.com -> OK
mail.domain.com -> OK
domain.com/webmail -> Redirects to domain.com:2096 on new server.

-----------------------------

So how can i redirect domain.com/webmail redirecting to old server email?

Thanks.

Best Regards.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463

acpro

Member
Mar 7, 2017
11
2
3
Portugal
cPanel Access Level
Root Administrator
Hi.

Thanks for pointing out.. i also find this useful:
tecadmin.net/add-custom-settings-in-whm-cpanel-apache-virtualhost/

Ended up doing this:
-For Apache 2.4, check Apache version and change 2_4 to Apache version
-Non SSL
Code:
mkdir -p /etc/apache2/conf.d/userdata/std/2_4/domain/domain.com/
cd /etc/apache2/conf.d/userdata/std/2_4/domain/domain.com/

nano extra.conf

ScriptAlias /webmail /home/domain/public_html/email/
ScriptAliasMatch ^/webmail/(.*) /home/domain/public_html/email/

/scripts/rebuildhttpdconf
service httpd restart
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello @acpro,

I'm happy to see you were able to find a solution. Thank you for updating this thread with the outcome.