How to make an exception in htaccess for https?

Transferred work site on https Protocol, but since the site is old, does not make it fully to https from unprotected content. In URLs there are pages like .../page/text.html but this folder is not present physically is a rule in htaccess makes this way. It turns code like this:

RewriteEngine On
RewriteBase /
RewriteRule ^page/(.*)$ page_redir.php?url=$1 [L]

RewriteCond %{REQUEST_URI} !^/page/.*$
RewriteCond %{HTTP_HOST} ^mysite\.com [NC]
RewriteCond %{HTTP:X-Forwarded-Proto} ^http$
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

But it does not work - instead goes to the url and https Protocol. Please advise how to get out of this situation?
August 19th 19 at 22:48
1 answer
August 19th 19 at 22:50
RewriteCond %{HTTP_HOST} ^(www\.|)mysite\.com [NC] - so what exactly is.
- it's all right as an option remove the extra space before ! and make softer the condition that will work ?
Also do not forget that html the idea is static, and can climb from nginx and not get to redirect in Apache in principle. Here it is necessary more in detail about conference server.
As well as the entire .htaccess
and why do you needRewriteCond %{HTTP:X-Forwarded-Proto} ^http$

Find more questions by tags htaccess