Как сделать редирект https на http
Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2023
Версия от 12:30, 14 июня 2019; Admin iph (обсуждение | вклад) (Новая страница: «=== Как сделать редирект https на http === Один из примеров редиректа https://site.com/ --> http://site.com/ чере…»)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Как сделать редирект https на http
Один из примеров редиректа https://site.com/ --> http://site.com/ через Rewrite в .htaccess:
RewriteEngine on RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
или редирект на другой сайт http:
RewriteCond %{HTTPS} on RewriteRule (.*) http://site.com/
Другой пример через проверку запроса X-Forwarded-Proto - идентифицирует какой протокол используеться http или https:
RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} https RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]