An SSL Certificate also is known as a secure socket layer certificate, and it offers security encryption for the websites. HTTP to HTTPS redirect .htaccess code, then you have to configure it in the .htaccess Redirect Domain.
YouStable offers cPanel to the users so they can enjoy the popular dashboard in the market today. Forcing the site to HTTP to HTTPS redirect is easy with cPanel. You need to have access to the cPanel login details that you can find in the registered email because we have sent you a copy of the details after the purchase.
Redirect HTTP to HTTPS Using .htaccess in cPanel
You can always revert the changes by following the steps backwards.
Step 1: Login to the control panel account by adding cPanel at the end of the domain, and it should look like this “youstable.com/cpanel” in the clipboard.
Step 2: Type “file manager” in the search bar, and click on the first result.
Step 3: cPanel hides important files and unnecessary files in the file manager, but you can view them. Click on the settings located at the top right menu, and a small window pop-up on your screen, then click on “show hidden files.”
Step 4: Now, go to “public_html” by double-clicking on it.
Step 5: You can locate the “.htaccess” file in the “public_html” and click on edit.
Step 6: A small confirmation window pop-up on your screen, and then click on “edit.”
Step 7: Now, you have to search for existing code by CTRL + S and type “RewriteEngine On.” If you already have the codes pasted in the file, then make sure to check if the RewriteCond and RewriteRule followed in the next lines.
If the codes are not present, then you can try the below codes and copy & paste them into the “.htaccess.”
Also, If you have a cPanel VPS Hosting, you can easily redirect all HTTP traffic to HTTPS by adding a few lines of code to your .htaccess file.
First
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Second
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Sign out from the cPanel, clear the cache from the browser, and then test the changes.