The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Change /webmail/ for only one domain

Discussion in 'E-mail Discussions' started by justhost, Oct 31, 2007.

  1. justhost

    justhost Well-Known Member

    Joined:
    Sep 2, 2003
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Halifax, Nova Scotia
    Hello

    We have a client who has been hosting their webmail in house and has been using the www.domain.com/webmail/ path for quite some time. they would prefer not to have to change anything. Since the server does the automatically loads the cPanel webmail when that path is broswed is there a way to work around this for that one domain?

    We have created a subdomain for webmail and redirected that to their server but that only works if you browse the subdomain (ie webmail.domain.com) but not if you go to www.domain.com/webmail/

    Any insight would be helpful.

    Thank you.
     
  2. DeepakW

    DeepakW Active Member

    Joined:
    Nov 13, 2005
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    You can do it by creating the subdomain webmail. It will create webmail directory in public_html. Once you have set the subdomain, create a .htaccess file in webmail
    directory and set following Rewrite rule in it.


    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^webmail.domainname$ [OR]
    RewriteCond %{HTTP_HOST} ^www.webmail.domainname$
    RewriteRule ^(.*)$ https://domainname:2096/ [R=301,L]
     
  3. DeepakW

    DeepakW Active Member

    Joined:
    Nov 13, 2005
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    Also you can do it by using frame forwarding. Create a webmail directory into public_html directory now create index.html page as follows

    <HTML>
    <FRAMESET ROWS="*,0" FRAMEBORDER=0 BORDER=0 FRAMESPACING=0>
    <FRAME SRC="https://domainname:2096/"
    </FRAMESET>
    </HTML>
     
  4. DN-Paul

    DN-Paul Well-Known Member

    Joined:
    Oct 30, 2003
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    That would just forward webmail.domain.tld to the cpanel webmail interface...

    This guy (and myself) wants to use his own webmail in a subdirectory called webmail, i.e. domain.tld/webmail
     
  5. Damian

    Damian Well-Known Member

    Joined:
    Oct 1, 2001
    Messages:
    95
    Likes Received:
    1
    Trophy Points:
    8
    The webmail alias is defined in the apache config file /usr/local/apache/conf/httpd.conf.

    So, and this is in theory and not something I have tested, you could possibly add your own ScriptAlias directive inside this customers VirtualHost container.

    i.e.
    Code:
    <VirtualHost xx.xxx.xxx.xxx>
       ServerAlias www.domain.com
       ServerAdmin webmaster@domain.com
       DocumentRoot /home/username/public_html
       BytesLog domlogs/domain.com-bytes_log
       User username
       Group groupname
       ServerName domain.com
    
       User username
       Group username
       CustomLog /usr/local/apache/domlogs/domain.com combined
       ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
       
       ScriptAlias /webmail/ /home/username/public_html/webmail/
    </VirtualHost>
    The last ScriptAlias /webmail/ entry above would by my suggestion. Of course after making this change you'll need to restart Apache for the change to take effect. I'm not familiar with ScriptAliasMatch and how they might affect this as they exist outside all VirtualHost directives. It may mean that if they visit www.domain.com/webmail/ it will work but if they leave off the trailing slash i.e. www.domain.com/webmail they might still get the direction.

    I hope that if this doesn't work exactly as you want it will at least set you in the right direction :)
     
  6. beley

    beley Active Member

    Joined:
    Feb 27, 2003
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Any word on this? I dont want to edit the httpd.conf file because I don't want the possibility that it'll get overwritten as cpanel updates, etc.

    I have the exact same need... I need to redirect /webmail to another site for webmail as one particular client has off-server email.

    Help, please?
     
  7. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
  8. iLLuSi0nS

    iLLuSi0nS Active Member

    Joined:
    Jun 9, 2007
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
Loading...

Share This Page