A brief guide to redirect website from HTTP to HTTPS using .htaccess or web.config file
Website security is an inevitable need for any business, as the user will experience safe environment over the website. Many sites run with both versions HTTP and HTTPS that could cause SSL warnings and entice hackers to breach the website. It is recommended to force SSL connection on your entire website and ensure that web users are browsing your site over HTTPS secure channel.
To redirect website from HTTP to HTTPS, you need to contain following code using .htaccess or web.config files which depends upon server you use.
Redirect HTTP to HTTPS using .htaccess
Linux & cPanel
You need to place below code in .htaccess file in the cPanel on your Linux based server. This code forces users to redirect to HTTPS connection.
RewriteCond %{HTTPS} !on [OR] RewriteCond %{HTTP_HOST} !^www\. RewriteRule (.*) https://www.domainname.com%{REQUEST_URI} [L,R=301]
Redirect HTTP to HTTPS using web.config
Windows & Plesk
You should use following code using web.config in Plesk panel on your Windows based server to redirect web traffic on HTTPS secure website.
<configuration> <system.webServer> <rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
Where To Buy an SSL Certificate?
If you wish to provide safe browsing experience for your online visitors and looking for cheap SSL certificate, then SSL2BUY can help you to choose right certificate for your website. SSL2BUY offers wide range of SSL certificates at an inexpensive price that matches your business needs. When SSL is enabled on your website, your website will have green padlock and HTTPS just before your website name.
Best Buy | |||
Product Name | Comodo PositiveSSL Certificate | AlphaSSL Wildcard Certificate | Comodo UCC/SAN/Multi-Domain SSL |
---|---|---|---|
Price |
$8.00/year
|
$26.00/year
|
$33.00/year
|
Algorithm | SHA-2 Enabled | SHA-2 Enabled | SHA-2 Enabled |
Search Engine Visibility | SSL will boost Google rankings | SSL will boost Google rankings | SSL will boost Google rankings |
Validation Type | Domain Validation - DV | Domain Validation - DV | Domain Validation - DV |
Issuance Time | 15 minutes or less | 15 minutes or less | 15 minutes or less |
Domains Secured | FQDN (www+non-www) | Unlimited subdomains | Secure up to 250 domains |
Server Licenses | Unlimited | Unlimited | Unlimited |
CSR Encryption | 2048-bit | 2048-bit | 2048-bit |
SSL Encryption | Up to 256-bit | Up to 256-bit | Up to 256-bit |
Mobile & smartphone support | 99% | 99% | 99% |
Browser compatibility | 99% | 99% | 99% |
Client OS compatibility | 99% | 99% | 99% |
Includes Malware Scan | |||
Includes Trust Seal | |||
Reissuance | Unlimited during certificate lifespan | Unlimited during certificate lifespan | Unlimited during certificate lifespan |
Warranty | $10,000 USD | $10,000 USD | $10,000 USD |
Refund Policy | 30 days full money back | 30 days full money back | 30 days full money back |
Vendor Price |
$39.20/year
|
$119.20/year
|
$264.00/year
|
Now Only |
$8.00/year
|
$26.00/year
|
$33.00/year
|