How to force a website to SSL only using .htaccess

Create a .htaccess file in your public_html folder and place in the following in that file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Retry and all pages should be forced to SSL https

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

530 Relaying not allowed in a Email Clients

This error occurs when a user or mail client attempts to send email without authenticating on the...

How to do a Telnet

Telnet is used to test open ports or administer remote servers via the command prompt.The telnet...

How to do a Tracert

A traceroute is a function which traces the path from one network to another. It allows us to...

How to do a Ping

Ping is a command used to test whether a host is reachable via your internet connection. The...

Error Page Codes

These are probably the most common error codes that a visitor might see, you may like to create...