How to redirect my website to be opened through HTTPS?

In order to redirect your website to be opened through HTTPS, you should add the following rewrite rule in your.htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://www.domain.com/%{REQUEST_URI} [R,L]

This will redirect your domain to https://www.yourdomain.com. If you wish the redirect to work without www, you should remove it from the rewrite rule:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://domain.com/%{REQUEST_URI} [R,L]

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Brute Force Attack – What it is and How to Block It

Brute-force is a method of guessing your password by trying combinations of letters, numbers and...

What is pdftoppm and is it supported by Hostlantern?

Pdftoppm is a library that handles the conversion from Portable Document Format (PDF) files to...

How to clear your Internet browser’s cookies?

Sometimes you may need to clear the cookies saved by your browser. Basically the cookies...

Hacked Website

The most common reasons for a hacked (defaced) website include: - Outdated web application....

How to clean my files from malicious code?

If your website has been hacked and malicious content has been inserted into your files, you...