Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2006
    Posts
    20

    Default Disable or Redirect /webmail/ for one domain

    We have a client that uses a third party email solution and would like to redirect the mydomain.com/webmail/ forwarder to this third party solution.

    Is there any easy way to do this? I have already tried the following htaccess file and creating a physical folder with a php redirect file. Neither worked.

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mail.mydomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.mail.mydomain.com$
    RewriteRule ^.*$ "https\:\/\/mydomain\.theemailhostingsite\.com" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mydomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.mydomain.com$
    RewriteRule ^webmail\/?(.*)$ "https\:\/\/mydomain\.theemailhostingsite\.com\/$1" [R=301,L]
    
    Redirect /webmail/ https://mydomain.theemailhostingsite.com/

  2. #2
    Member SageBrian's Avatar
    Join Date
    Jun 2002
    Location
    NY/CT (US)
    Posts
    386

    Default

    Quote Originally Posted by jer2eydevil88 View Post
    We have a client that uses a third party email solution and would like to redirect the mydomain.com/webmail/ forwarder to this third party solution.
    Wouldn't it be easier to edit the DNS record and point webmail.mydomain to the 3rd party?
    Have your own Personal Web Address yet? GetMyFamilyName.com
    On this forum nobody needs Professional Website Management, but I put this for silly PR - SevenSages.com

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    4

    Default

    Hi,

    I have a similar problem. My client also uses a third party email solution and I created a webmail.domain.com CNAME to webmail.thirdparty.com but when one calls the URL webmail.domain.com, instead of redirecting to the third party webmail server, cPanel shows it's own webmail login.

    BTW, I didn't forgot the trailing dot after webmail.thirdparty.com.

    I'll appreciate any clue about this.

    Cheers,
    Ricardo

  4. #4
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    Try this to make webmail.domain.com to work :

    1. Create an ‘A’ record for the sub-domain ‘webmail’ in the DNS zone file. It should look like :

    Code:
    domain.com. IN A XX.XX.XXX.XXX
        localhost.domain.com. IN A 127.0.0.1
        domain.com. IN MX 0 domain.com.
        mail IN CNAME domain.com.
        www IN CNAME domain.com.
        ftp IN A XX.XX.XXX.XXX
        cpanel IN XX.XX.XXX.XXX
        whm IN A XX.XX.XXX.XXX
        webmail IN A XX.XX.XXX.XXX
        webdisk IN A XX.XX.XXX.XXX
    2. Put the following code inside .htaccess in the sub-domain folder ( virtual sub-domain which doesn’t have an entry in httpd.conf

    Code:
     RewriteEngine on
        RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
        RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
        RewriteRule ^.*$ “http\:\/\/domain\.com\/webmail” [R=301,L]
    To prevent forwarding of ‘/webmail’ to cPanel’s webmail interface , follow the steps below :

    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:

    *REMOVE*

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

    4. Save your changes and exit the editor

    5. Execute /scripts/check_cpanel_apache_aliases

    Users can still access cPanel's webmail via ports 2095/96

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 07-20-2011, 08:50 AM
  2. how do I disable webmail access for one domain only?
    By SoftDux in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 03-30-2011, 04:08 PM
  3. Change /webmail Redirect for One Domain
    By orty in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-12-2008, 04:07 PM
  4. can you DISABLE /webmail redirect
    By wjtaylor in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 01-20-2006, 04:59 PM
  5. Webmail url, how I can disable, one domain?
    By x-man in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-08-2005, 03:30 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube