1. bluehost knowledge base

Resellers: Custom Login Page

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



 

Setup the .htaccess file

For your custom login page to work you will need to ensure that the .htaccess file in your home directory is set up correctly. There are two ways of doing this.
 

Use the Reset login domains tool in WHM

Warning! Using this tool will replace the .htaccess file in the home directory.
  1. Login to your Bluehost reseller account
  2. Choose WHM
  3. Scroll down to the Plugins section
  4. Click the Reset login domains plugin.
  5. Click Yes to replace the .htaccess file in your home directory, removing any custom code that might be there now.

 

Manually modifying the .htaccess file

If you would prefer to modify the .htaccess file manually, located in the home directory, here is the code you will need to use:
# 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]
Note: Any changes to this code will cause the login process to fail. 
 

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.


Warning: You must have the WildCard SSL Certificate installed on your account for this to work. Please see "How to Purchase a Comodo Private SSL" to see how to install the SSL Certificate.
	<form action="/cgi-sys/login.cgi" method="POST">
Note: The action must be /cgi-sys/login.cgi and the method must be POST
	<input class="lti" name="user" value="">
Note: 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="">
Note: 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">
Note: 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">
Note: The submit button, type must to be submit, however any other attributes can be modified.
	<span class="error" id="general_error"></span>
Note: 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.