Forum categories

переход в http на https

переход в http на https

fomin
fomin • 2024-07-03 16:34 #63

как переход в http на https на сборке fobiz 

в конфиге исправил на https 

 

вводил коды в htaccess

адрес сайта вставляем без HTTPS.

Options -Indexes

RewriteEngine On

#301 редирект с домена с WWW на домен без WWW

RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]

RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L]

#Перенос сайта на версию с HTTPS (для всех страниц)

RewriteCond %{SERVER_PORT} ^80$ [OR]

RewriteCond %{HTTP} =on

RewriteRule ^(.*)$ https://mysite.com/$1 [R=301,L]


И так…
Вариант №1

RewriteCond %{HTTPS} =off

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]


Вариант №2

RewriteCond %{SERVER_PORT} !^443$

RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]


Вариант №3

RewriteCond %{ENV:HTTPS} !on

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Вариант №4

RewriteCond %{HTTP:X-HTTPS} !1

RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]


Вариант №5

RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'

RewriteRule ^(.*)$ https://www.site.ru/$1 [L]


Вариант №6

RewriteCond %{HTTP:X-Forwarded-Protocol} !=https

RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]


Вариант №7

RewriteCond %{HTTP:X-Forwarded-Proto} !https

RewriteCond %{HTTPS} off

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]


Вариант №8

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteCond %{HTTP:X-Forwarded-Proto} !https

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

 

шаблон криво работает 

This post was edited by webitproff (2024-07-04 01:23, 2 years ago)
🗿

🧙‍♂️ Well met, good traveler! Fate has guided your steps to our humble realm. Here, wise sages and masters of the coding craft ⚒️📜 gather to unravel the mysteries of the code ✨⚙️, share their knowledge, and add new chapters to our chronicles.
⬅️ To the left lie ancient scrolls 📚 filled with forgotten wisdom. ⬆️ Straight ahead, friendly folk offer counsel 💬 to those in need. ➡️ To the right, you may become a chronicler ✍️ yourself, sharing your craft and leaving words of wisdom for those yet to come.
📝 Delay no longer—tell us the name by which you are known, complete the rite of registration 🛡️, and join our fellowship!
🏰 Our brotherhood holds no secret initiation, yet many halls remain closed to wandering guests, for some knowledge 💎 is reserved for those who choose to walk this path beside us.