Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member orty's Avatar
    Join Date
    Jun 2004
    Location
    Bend, Oregon
    Posts
    105
    cPanel/Enkompass Access Level

    Root Administrator

    Default Change /webmail Redirect for One Domain

    I have a client who is starting to use and outside mail service (google apps for domains, if you must know). They've become accustomed to going to domain.com/webmail to get the webmail login and they're hard folks to re-train, so I'd rather they just keep going there. However, that's hardcoded in httpd.conf server-wide to go to cPanel's webmail login.

    Is there any way I can turn off that redirect for just this one domain so I can just create a webmail folder that has a redirect inside it to their new service's login (which is just http://mail.google.com/a/domain.com)?

    Thanks!
    -orty

  2. #2
    Member orty's Avatar
    Join Date
    Jun 2004
    Location
    Bend, Oregon
    Posts
    105
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    ...Anybody?

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

    Default

    Maybe you can try to redefine Alias "/webmail" for that domain within <virtualhost> tags?

  4. #4
    Member orty's Avatar
    Join Date
    Jun 2004
    Location
    Bend, Oregon
    Posts
    105
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    In case anybody else is trying this, I put this in that particular domain's VirtualHost declaration:

    Code:
    ScriptAlias /webmail /home/user/public_html/email/index.cgi
    ScriptAliasMatch ^/webmail/(.*) /home/user/public_html/email/index.cgi
    So basically, I'm redirecting /webmail to a folder called "email" that has index.cgi in it. I'm basically copying the above code from the top of the httpd.conf file as that's what cPanel uses for its redirect for /webmail:
    Code:
    ScriptAlias /webmail /usr/local/cpanel/cgi-sys/wredirect.cgi
    ScriptAliasMatch ^/webmail/(.*) /usr/local/cpanel/cgi-sys/wredirect.cgi
    Inside that index.cgi file, I have a simple perl script that redirects to the proper page:
    Code:
    #!/usr/bin/perl
    use CGI; 
    my $q = CGI->new(); 
    print $q->redirect( 
      -location => 'http://mail.google.com/a/domain.com', 
      -status => 302,
    );
    So far it seems to work. Thanks!
    (edited this entry as I initially posted that it didn't work, but I had a typo in my perl code)
    Last edited by orty; 02-12-2007 at 06:01 PM. Reason: I screwed up....

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

    Default

    cool. Thanks.

    So, this would likely be a way to create a server wide redirect I assume.

    I'm thinking of offering an alternative webmail option, with more customized options, and to get around that pesky port issue for those behind firewalls.

    I'm planning on setting up Squirrelmail on an account, give it an SSL cert (self-signed might be good enough). This allows for access to mail thru port 80, and allows me to add and tweak features of SquirrelMail that wouldn't get over-written with a cpanel update.

    Code:
    ScriptAlias /supermail /home/supermail/public_html/email/index.cgi
    ScriptAliasMatch ^/supermail/(.*) /home/supermail/public_html/email/index.cgi


    Code:
    #!/usr/bin/perl
    use CGI; 
    my $q = CGI->new(); 
    print $q->redirect( 
      -location => 'https://supermail.hostname.com', 
      -status => 302,
    );
    I knew someone would share a solution.
    Thanks buddy.

  6. #6
    Member
    Join Date
    Jun 2007
    Posts
    43

    Default

    Can I use this to redirect to https://hostname.domain.com:2096/3rd.../src/login.php

    ?

    And how would I do it so its global so I dont have to manually add it to every virtualhost, have it done for all accounts?

    Thanks

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 07-20-2011, 07:50 AM
  2. how to change domain.com/webmail to mail.domain.com
    By abhinavkumar in forum E-mail Discussions
    Replies: 4
    Last Post: 12-08-2010, 12:49 AM
  3. Disable or Redirect /webmail/ for one domain
    By jer2eydevil88 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-06-2009, 03:01 AM
  4. How to change webmail URL for add on domain name
    By fredcwk in forum New User Questions
    Replies: 1
    Last Post: 08-06-2009, 10:19 AM
  5. Change /webmail/ for only one domain
    By justhost in forum New User Questions
    Replies: 7
    Last Post: 06-12-2008, 03:58 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube