by

Guide to Force HTTPS htaccess [Terlengkap]

Assalamualikum, Friends of #Bacanews Wherever you are, this time I will discuss some important things for the survival of your website in the future. Please see the article below.

You just installed SSL on your website and hope the URL will change to https: //your website. However, in reality there is no lock icon in the browser, which means that the website is not SSL protected. Wow, how do you do that?

Quiet! The solution is to force https htaccess. You don’t know how?

In this article, you will learn how to force HTTPS using .htaccess. So, your website can be directed to always use https as a secure protocol with SSL protection.

Without further ado, let’s follow the discussion further!

Setting Force HTTPS htaccess for Website

Here’s how to force HTTPS settings using .htaccess so that all your website pages will appear with a URL https://websiteanda.com:

  1. Login to your cPanel at http://yourdomain.com/cpanel. Then, select the menu File Manager in the Files.
  2. Enter the folder public_html, then right-click the file .htaccess and choose Edit.
    the second step to force https htaccess is to edit the htaccesss file
  3. Enter the following script right below RewriteEngine On

    RewriteCond% {HTTPS} is off
    Rewrite Rules ^ (. *) $ Https: //% {HTTP_HOST}% {REQUEST_URI} [L,R=301]

    the third step force https htaccess

  4. Click Save changes at the top right to save the script. Try again to access your website, and make sure the URL is used already https://namawebsite.com.

Attention!


If you can’t find the .htaccess file, follow the guide below to display it:

How to Show Hidden Files (. Htaccess) Through File Manager ›

Setting Force HTTPS htaccess for Specific Domains

If you have two domains that point to the same website, but only want one of them to use HTTPS, you can follow the method below:

  1. Login to your cPanel at http://yourdomain.com/cpanel. Then, select the menu File Manager in the Files.

  2. Enter the folder public_html, then right-click the file .htaccess and choose Edit.

    the second step to force https htaccess is to edit the htaccesss file

  3. Enter this script right below RewriteEngine On

    RewriteCond% {HTTP_HOST} ^ yourdomain1.com [NC]
    RewriteCond% {HTTPS} is off
    Rewrite Rules ^ (. *) $ Https: //% {HTTP_HOST}% {REQUEST_URI} [R=301,L]

    Don’t forget to replace domainanda1.com with your domain name that you want to redirect to HTTPS. For example, niagahoster1.com like this:

    how to Setting Force HTTPS htaccess for Certain Domains

  4. Click Save changes at the top right to save the script. Try to access the domain again. If you are already using a URL with HTTPS, it means that the setup was successful.

Setting Force HTTPS htaccess for Specific Directories

What if you only want HTTPS for specific directories on your website? You can too. Here’s how:

  1. Log back in to your cPanel at http://yourdomain.com/cpanel. Then, select the menu File Manager in the Files.

  2. Enter the folder public_html and right-click the file .htaccess, then select Copy.

    second step Setting Force HTTPS htaccess for a specific directory

  3. Type in the directory that you want to make HTTPS. For example, directory examples of folderhttps. Then, click Copy Files.

    Setting Force HTTPS htaccess for Specific Directories step three

  4. Enter the directory you want to make HTTPS. Here, you will find the .htaccess file you just copied. Right-click the .htaccess file, then select Edit

  5. Enter this script right below RewriteEngine On

    RewriteCond% {HTTPS} is off
    Rewrite Rules ^ (. *) $ Https: //% {HTTP_HOST}% {REQUEST_URI} [L,R=301]

    the third step force https htaccess

  6. Click Save changes to save the script. Now, try to access that directory. If the directory displays a lock icon, then force HTTP using .htaccess has been successful!

Setting Force HTTPS Instantly (Bonus)

Do the above methods seem troublesome to you? Quiet! You can also force HTTPS instantly with just one click, you know! How to?

  1. Login to your Niagahoster Member Area.
  2. Click WordPress Management and choose Site. In the WordPress Management page on the right side, there is a menu Force HTTPS in a Dead state. Click the menu to activate it.

  3. Wait a few moments until a notification appears like this:
  4. Click Back and try to access your website a few minutes later. When accessing your website, a padlock icon should appear, indicating that SSL protection has been activated.

Conclusion

How? It turns out that force HTTPS htaccess is very easy, right? So, you don’t need to panic anymore when you feel that SSL is not yet active because the URL is still using HTTP.

You can choose how to force HTTPS .htaccess as needed. Besides being able to be used for the entire website, setting force HTTPS using .htaccess can also be applied to certain domains and directories. However, make sure you have chosen the correct domain or directory, yes!

If you are a Niagahoster customer, force HTTPS htaccess can be done in an instant way. You just have to log in to the Member Area and click the button Force HTTPS which has been provided. As a result, your website will get SSL protection in an easier way.

I want to subscribe to Niagahoster hosting services

Hopefully the force .htaccess guide above was of use to you. If you have questions or are having trouble carrying out the steps, just leave a comment below, yes. Good luck!

The post Guide to Force HTTPS htaccess [Terlengkap] first appeared on the Niagahoster Blog.

Tema WordPress Berita

Tips and Triks

Guide to Force HTTPS htaccess [Terlengkap]

#Guide #Force #HTTPS #htaccess #Terlengkap

Baca juga :  Bisnis Model Canvas: Apa itu dan Bagaimana Cara Membuatnya?

Comment

Leave a Reply

News Feed