
HostingSewa offers SSL certificate with its entire web hosting plans. You can activate this SSL in your Control Panel under Security > SSL/TSL or SSL/TSL Status.[/caption]
So, the visitors on your website should be accessing it using an SSL-encrypted connection for additional security, accessibility or PCI compliance.
HostingSewa offers SSL certificate with its entire web hosting plans. You can activate this SSL in your Control Panel under Security > SSL/TSL or SSL/TSL Status.
You can force visitors to use SSL through your .htaccess file using mod_rewrite.
How to redirect your website from HTTP to HTTPS using .htacess?[/caption]
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
If the above code isn’t working, remove the first two lines and run the code as below:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
Ensure that you replace example.com with the domain name for which you are forcing https. Also, you need to replace www.example.com with your actual domain name.
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.example.com/folder/$1 [R=301,L]
Ensure that you change the folder reference to the original folder name. Then make sure to replace www.example.com/folderwith your original domain name and folder, you want to force the SSL on.
In this way, you can easily change your website from HTTP to HTTPS using the .htaccess.Advertisement