A
A
Agatnet2018-06-28 15:02:46
cloudflare
Agatnet, 2018-06-28 15:02:46

How to force a site to open only on https?

There is a WordPress site hosted on arubacloud (ubuntu 16.04). Vesta control panel. The domain is directed to cloudflare (free), SSL is set to "Flexible" In WordPress, in the general settings, the site address is set as https://name.site When you enter the address in full (with a protocol), it opens both via http and https. when you enter only the site name site.name or www.site.name opens via http. Admin panel opens immediately on https
How to make (correctly) that the site opens only on https? Where to dig? Vesta, .htaccess, wordpress?
check result via https://2ip.ru/ssl-info/
------------------------------------ ---------------------------
Name Let's Encrypt Authority X3
Company Let's Encrypt
Localization US
Validity period from 03/17/2016 to
03/17/2021 Serial number 13298795840390663119752826058995181320
Signature algorithm RSA-SHA256
Certification authority DST Root CA X3

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ruslan Fedoseev, 2018-06-28
@martin74ua

redirect to https server in http server settings.
add an HSTS header to your site so that later client browsers don't try to connect via http

A
Alexander M, 2018-06-28
@alexander7779

Maybe the problem is in the .htaccess file, there is a forced redirect.
RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
don't forget to write higher from www to without www (or vice versa)
RewriteEngine On
RewriteCond % {HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

M
Mr Crabbz, 2018-06-28
@Punkie

Even easier: in the cloudflare settings in the Crypto tab:
5b34dcb30b082422094453.png5b34dcb85b645812784210.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question