Pages

Friday, September 19, 2014

How to redirect webmail.domain.com to domain.com/webmail?

Here is the steps:-

Make changes to zone db ( Ie /var/named/domain.com.db)
create a subdomain webmail
entry wil be like this

    ==========================
    domain.com. IN A 64.20.54.242
    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 67.20.54.242
    cpanel IN A 67.20.54.242
    whm IN A 67.20.54.242
    webmail IN A 67.20.54.242
    webdisk IN A 67.20.54.242
    ======================

Put the following rule in subdomain folder ( virtual subdomain which doesnmt have entry in httpd.conf file

ie /home/domain/public_html/webmail directory

    ==================================
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
    RewriteRule ^.*$ “http\:\/\/domain\.com\/webmail” [R=301,L]
    ==================================

No comments:

Post a Comment