This article provides you with steps to create customer login pages for your clients if you are a Reseller on a Business VPS.

 

 

INFO: You must have the WildCard SSL Certificate installed on your account for this to work. Please see How to Purchase a  SSL  here.

 

 

Setup the .htaccess file

For each domain account you would like to setup a custom login page you will need to setup an htaccess file in the domain’s root directory (public_html).

Below is the code that would need to be added to the .htaccess file.

# This is the code that handles login., cpanel., and webmail.
            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^login\. [NC,OR]
            RewriteCond %{HTTP_HOST} ^cpanel\. [NC,OR]
            RewriteCond %{HTTP_HOST} ^webmail\. [NC]
            RewriteCond %{REQUEST_URI} !^/(cgi-sys|rhost_login)
            RewriteRule ^(.*)$ /cgi-sys/login.cgi [NC,L]

 

Creating the custom login page

The custom login page will need to be placed in the ~/public_html/login/default.html file. Your customers would login at http://example.com/login/.

The following are the required lines that must be included in your form. You may style the page as you wish, but the following information must be included.

INFO: You must have the WildCard SSL Certificate installed on your account for this to work. Please see “How to Purchase a Comodo Private SSL” 

                <form action="/cgi-sys/login.cgi" method="POST">

The action must be /cgi-sys/login.cgi and the method must be POST

                <input class="lti" name="user" value="">

The user field, the name must be user. class and value are optional, value should be set to “” if used at all

                <input class="lti" name="pass" type="password" value="">

The pass field, the name must be pass and the type must be password. class and value are optional, value should be set to “” if used at all.

                     <input type="hidden" name="goto_uri" value="/cpanel">

The name MUST be goto_uri, and the value MUST be “/cpanel” including the preceding / and the type MUST be hidden. If this field is not present or set properly, the login will not work.

                <input id="login_button" type="submit" value="Login">

The submit button, type must be submit, however any other attributes can be modified.

                <span class="error" id="general_error"></span>

This tag is optional but highly recommended. Any errors generated during the login process are sent to this element. You may stylize this as you wish, but the ID must be general_error.


TIP: To see more articles related to WHM please see this category here.