apache https redirect

20.11.2019 / 0 comments

RewriteCond %{HTTP_SCHEME} !https RewriteCond %{HTTP_HOST} !vadimdenisov.ru RewriteRule «.?» «-» [S=1] RewriteRule ^(.*)$ https://vadimdenisov.ru/$1 [R=301,L] Надо проверить

php redirect https

19.11.2019 / 0 comments

if ($_SERVER[‘HTTP_SCHEME’] != ‘https’) { header(«HTTP/1.1 301 Moved Permanently»); header(«Location: https://vadimdenisov.ru».$_SERVER[‘REQUEST_URI’]); exit(); } При наличии nginx, в конфиге nginx должно быть proxy_set_header Scheme $scheme;