How to Set Drupal to Use HTTPS Using SSL Certificate

How to Set Drupal to Use HTTPS Using SSL Certificate

If you are using a Drupal site, there are a couple easy ways on how to Set Drupal to use HTTPS using SSL Certificate. Depending on your preference, you can have your entire site protected with SSL or have only some of its pages use the HTTPS protocol.

This gives you the freedom to manage which parts of your Drupal site should be highly protected and which parts or pages can be open. This makes the loading of your site to be faster, which SSL Certificate protected websites tend to become a little bit slower than before the installation.

But since overall protection is recommended to ensure that your website is secured, securing your entire website with SSL Certificate is advisable.

Setting Your Drupal site to Use the HTTPS Protocol

Here are some ways on how to Set Drupal to use HTTPS using SSL Certificate. You might make some mistakes along the way so it would be best to have a backup copy of your website somewhere safe. This will allow you to get your site back to normal if there are errors that require redoing of the entire process:

  • Edit the .htaccess file.

Editing the .htaccess file of your website will make your entire website use the HTTPS protocol. There are no modules needed when you use this simple technique, which does not even actually need a lot of knowledge about the files on your site, making it a good option for beginners.

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

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The code above should be put at the bottom of your .htaccess file. That code will also include the setting up of the ‘www’ prefix on your website to unquote all the prefixes on your website since it is already taken care of by the code above.

  • Use Drupal modules.

Another thing that you can do to make your Drupal site switch from HTTP to HTTPS and vise versa is to use Drupal modules. This will do the work for you, which will prevent accidental errors that can cause you your site.

Even though you already have a backup file, it is better to make things right the first time to keep your site up and running all the time.

Use SecurePages module to set up your Drupal site to use HTTPS through SSL Certificate.

  • Use other modules.

You can also use Custom SSL Redirect to define which parts of your website you want to secure. Just make sure that you set this up properly to avoid it making your site inaccessible. It would be best to try to have someone to guide you when using this module.

Best Place to Purchase an SSL Certificate

If you are looking for the best place to buy your SSL Certificate, go to GoDaddy. They are offering the best certificates for websites at the most affordable prices. Just contact their support to that they can give you the type of certificate that you need for your Drupal site.

Previous post:

Next post: