Как сделать редирект https на http
Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2023
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://example.com/ --> http://example.com/ через Rewrite в .htaccess:
RewriteEngine on RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
или редирект на другой сайт http:
RewriteCond %{HTTPS} on RewriteRule (.*) http://example.com/
Другой пример через проверку запроса X-Forwarded-Proto - идентифицирует какой протокол используеться http или https:
RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} https RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]