Как сделать редирект с http на HTTPS
![Редирект с http на https](https://i0.wp.com/treeone.ru/wp-content/uploads/2017/01/2017-01-12_00-57-26.png?fit=825%2C488&ssl=1)
В связи с недавними обновлениями от Google и неизбежностью перехода на HTTPS, оставлю здесь небольшую инструкцию по редиректу сайтов на защищенный протокол https.
Для этого в .htaccess сайта надо добавить следующие параметры
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context
Отблагдарить автора статьи также можно переводом, +100 вам в карму!