Restricting Webmail Client

From Lunarpages Web Hosting Wiki

You can restrict which email program your webmail users are allowed to use by doing the following:

  • Login to CPanel or LPCP
  • Click on Subdomains
  • You will see a blank form to fill out with one next to it saying In that blank spot enter what you want to use as your subdomain. For example, webmail. It may take a minute so be patient!
  • Once you get a confirmation message, click the go back link (do not use the back button!).
  • In the line below the one you just filled out, select the in the box and click on Setup Redirection.
  • In the page that loads next enter one of the following URLs for the program you want users to be able to access. The trailing slash must be used:


  • Horde:
  • RoundCube:


  • RoundCube:

(Replace server with the name of your LPCP server.)

  • Click on Save.
  • Try and access - Login with your full email address and password, you should automatically be at the program of your choice!

Alternate method using .htaccess

  • Login in to your cpanel interface.
  • Select the Subdomain option, and create the subdomain. (ex:
  • Once it has been created, go to the File Manager option of the cPanel.
  • Navigate to public_html by selecting the folder image beside the text 'public_html'
  • Navigate to the folder that was create by your subdomain. (in the case of the example it would be the 'webmail' folder)
  • Once inside this directory, you will either see or need to create an .htaccess file. If there is no .htaccess read this article: Create_htaccess.
  • To Redirect to the Horde Webmail Client:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteRule ^(.*)$$1 [R=301,L]

NOTE: replace '' above with your actual domain name.

  • Go to the bottom of the page and click 'Save'.
  • Now go test the subdomain in your browser.

Everything should be setup and fully functional.

You can also use a secure login to the webmail as well, for the line:

RewriteRule ^(.*)$$1 [R=301,L]

Change this to:

RewriteRule ^(.*)$$1 [R=301,L]

For further help with this situation, please visit the lunarforums.

More about .htaccess can be found here:

More about .htaccess rewrites can be found here: