If you are able to use .htaccess, put a file .htaccess with the following configuration in the root folder of the mail.abc.com
host:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/~(.*)
RewriteRule ^(.*)$ http://webpages.abc.com/~%1 [R=302,L]
RewriteCond %{REQUEST_URI} ^(.*)
RewriteRule ^(.*)$ http://webmail.abc.com%1 [R=302,L]
What happens:
- Line 2 and 3 is the first set of RewriteCond and RewriteRule. The RewriteRule in the third line will redirect to http://webpages.abc.com/ only, if mail.abc.com was called with
~
in the URL segment. So if I try to open for examplehttp://mail.abc.com/~m_eberhard
I will be redirected tohttp://webpages.abc.com/~m_eberhard
. - The next set in line 4 and 5 will redirect everything else to webmail.abc.com. If I try to open
mail.abc.com/asdasdasd
I will be redirect towebmail.abc.com/asdasdasd