Using mail.domain.com to access webmail in bluehost

If you use bluehost and are familiar with webmail, you know that there are several ways to access webmail in a browser. I usually use shawnlelle.com/webmail. Many people, however, use mail.theirdomain.com to access mail. For a vast majority of people this works flawlessly. There are a few people, however, that this will not work for.
I first learned about this when I got a chat from another tech one Saturday. He had gotten a dedicated IP and was no longer able to access webmail using mail.hisdomain.com. Baffled, I tried on my account. Same issue. After much digging I found that it was the dedicated IP itself causing the issue as mail.domain.com, by default, is set to go to the domain. This is fine on shared servers. I tried several things to fix this from redirecting to changing the cname and a record. nothing worked. Days later, I was talking to an L3 friend of mine about the problem and he gave me an idea for fixing the problem. After a bit more research, I came up with a solution that works flawlessly.
Here are the steps:
1) Create a new subdomain: mail.domain.com and point it to the folder .mail in public_html.  you’ll need to delete any existing zone files for the mail first using the dns zone editor.
2) Add the following code to the .htaccess file for the .mail folder:

RewriteEngine On

RewriteCond %{SERVER_PORT} =80
RewriteCond %{HTTP_HOST} ^mail(\.[^.]+)+$
RewriteRule .* http://%{HTTP_HOST}:2095 [R=301,L]

RewriteCond %{SERVER_PORT} =443
RewriteCond %{HTTP_HOST} ^mail(\.[^.]+)+$
RewriteRule .* https://%{HTTP_HOST}:2096 [R=301,L]

Each domain will need to have a mail subdomain created and all will need to go to the .mail folder in public_html.  I did this on my account and it works perfectly.  Anyway, just thought you’d like to know.