Jump to content

How to enable a SSL (https) across WHMCS


Recommended Posts

Depending on your web server, you should enforce this with .htaccess.

Create a new file in your WHMCS root called .htaccess and add the following lines of code:

## Moving to HTTPS ##

RewriteEngine On

RewriteCond %{HTTPS} !=on

# This checks to make sure the connection is not already HTTPS

RewriteCond %{HTTP_HOST} ^(www\.)?YOURDOMAIN\.com$ [NC]

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

If you already have .htaccess (likely) add the code at the bottom of the file after everything else. If you look inside the file and find that "RewriteEngine On" already exists, simply add the code without the directive, as such:

## Moving to HTTPS ##

RewriteCond %{HTTPS} !=on

# This checks to make sure the connection is not already HTTPS

RewriteCond %{HTTP_HOST} ^(www\.)?YOURDOMAIN\.com$ [NC]

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

 

Link to comment
Share on other sites

Three lines in htaccess, at the top, not that hard to do
 

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]

No special rewrites needed, no modification of the URl needed, it just works

WHMCS v7 may have changed some things in v7, but it's still a good idea to have that in .htaccess

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated