This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here

Skip to main content

Just Host Web Hosting Help

Wildcard SSL Certificates

Overview

This article will show you how to use your WildCard SSL Certificate, on your Just Host hosting account, using mod_rewrite. This is required due to a limitation in WHM that only allows there to be one virtualhost entry.



Folder Structure

The subdomain must be assigned to a folder that is underneath the folder its parent domain is assigned to. Because of the way subdomains are assigned, it's easy for a subdomain to not be put inside the parent domains folder. You will need to reassign the domain to a folder under the parent domain in this situation.
Example: Say you have a wildcard SSL certificate for example.com. Example.com is assigned to the public_html folder. I want to use my certificate on sub.example.com. In this case sub.example.com should be assigned to public_html/sub/ because sub is a directory underneath public_html.

Accessing the .htaccess File

The .htaccess file is located in the parent domain's folder. While you can use an FTP or an SSH client to access the file, for this article we will be using the File Manger.

  1. Login to your Just Host cPanel
  2. Click the "File Manager", located in the Files section of the cPanel.
  3. Check the box "Show Hidden Files (dotfiles)."
  4. Right click the .htaccess file and choose "Edit" or "Code Edit
  5. For basic HTML sites follow the instructions under Generic mod_rewrite Rule and copy the code into the Editor. If you have a WordPress, Joomla or Drupal site follow the instructions under WordPress/Joomla/Drupal mod_rewrite Rule.
  6. Click Save Changes.

Generic mod_rewrite Rule

If you have a basic HTML site copy the following text into your public_html/.htaccess file.
Note: You should not use this if you have a WordPress, Joomla or Drupal site. Use the instructions under WordPress/Joomla/Drupal mod_rewrite Rule instead.

You will need to replace subdomain with your subdomain and example.com with your domain name.


            # Justhost.com
            #.htaccess WildCard SSL
            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^subdomain.example.com$
            RewriteCond %{REQUEST_URI} !^/subfolder/
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /subfolder/$1
            RewriteCond %{HTTP_HOST} ^subdomain.example.com$
            RewriteRule ^(/)?$ subfolder/index.php [L]
                

Once you have modified this code you may need to clear your browser cache to be able to see the redirect.

WordPress/Joomla/Drupal mod_rewrite Rule

For WordPress, Joomla or Drupal sites copy the following code:

If Just The Subdomain Holds either a WordPress, Joomla, or Drupal Site

If your subdomain holds either a WordPress, Joomla, or Drupal site but the parent domain does not, copy the following code.

You will need to replace subdomain with your subdomain and example.com with your domain name.

            # Custom subdomain .htaccess SSL + WordPress
            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^subdomain.maindomain.com$
            RewriteCond %{REQUEST_URI} !^/subfolder/
            RewriteRule ^(.*)$ /subfolder/$1
            RewriteCond %{HTTP_HOST} ^subdomain.maindomain.com$
            RewriteRule ^(/)?$ subfolder/index.php [L]
            # End custom subdomain .htaccess
                  

If The Parent Domain has WordPress

If both the parent domain and the subdomain have either a WordPress, Joomla, or Drupal site copy the following code into your .htaccess file. This code will replace the WordPress permalink code.

You will need to replace subdomain with your subdomain and example.com with your domain name.

            # Custom subdomain .htaccess SSL + WordPress
            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^subdomain.maindomain.com$
            RewriteCond %{REQUEST_URI} !^/subfolder/
            RewriteRule ^(.*)$ /subfolder/$1
            RewriteCond %{HTTP_HOST} ^subdomain.maindomain.com$
            RewriteRule ^(/)?$ subfolder/index.php [L]
            # End custom subdomain .htaccess
            
            # Custom maindomain .htaccess WordPress
            RewriteEngine On
            RewriteBase /
            RewriteCond %{HTTP_HOST} ^(www.)?maindomain.com$
            RewriteRule ^index\.php$ - [L]
            RewriteCond %{HTTP_HOST} ^(www.)?maindomain.com$
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule . /index.php [L]
            # End custom maindomain .htaccess
                  

You may need to clear your browser cache for the new rules to work. After that your Wildcard SSL certificate should be working.

Knowledgebase Article 222,395 views bookmark tags: htaccess reseller ssl subdomain subfolder wildcard


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

How to install the provided WildCard SSL on a reseller account
Knowledgebase Article 113,069 views tags: reseller ssl

How do I use the free shared SSL Certificate?
Knowledgebase Article 942,922 views tags: activate certificate install path shared ssl

How to renew an existing SSL certificate--or purchase a new one, within your cPanel
Knowledgebase Article 330,473 views tags: cert certificate layer secure security socket ssl

Related Help Content

This article explains how to download a copy of your SSL certificate.
Knowledgebase Article 229,002 views tags: certificate move ssl

Do you support wildcard subdomains or wildcard DNS entries?
Knowledgebase Article 313,745 views tags: dns domain subdomain wildcard zone

This article will explain the process for uploading an SSL Certificate to SiteLock's dasboard. The steps for accessing the SSL Manager may vary depending on which user interface your account uses.
Knowledgebase Article 88,917 views tags: bundle ca certificates security sitelock ssl

How to add a new SSL certificate for your different WM services.
Knowledgebase Article 155,720 views tags: ssl whm

I need to have an SSL 3rd Party Certificate installed for my domain.
Knowledgebase Article 484,791 views tags: certificate ssl

How to force https on entire website.
Knowledgebase Article 377,627 views tags: htaccess ssl website

How to reset the SSL certificates for your servers services
Knowledgebase Article 101,958 views tags: ssl whm

SSL/TLS Certificates and Addon Domains.
Knowledgebase Article 183,574 views tags: ssl

** Google ad credits are only available to customers in the United States, Canada, and the United Kingdom at this time.

¹ VAT (Value Added Tax) is not included in our advertised price and will be charged separately and itemized on invoices and billing information. Standard VAT rates based on EU Member State regulations may apply. Learn more.