This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
сервис_http [2022/01/19 11:44] val [Статический документ] |
сервис_http [2022/01/19 13:20] val [Редирект HTTP на HTTPS] |
||
---|---|---|---|
Line 553: | Line 553: | ||
# a2enmod rewrite | # a2enmod rewrite | ||
- | # service apache2 restart | + | # cat /etc/apache2/sites-available/000-default.conf |
- | + | ||
- | # cat /var/www/html/.htaccess | + | |
</code><code> | </code><code> | ||
- | RewriteEngine On | + | <VirtualHost *:80> |
- | RewriteCond %{HTTPS} !=on | + | ... |
- | RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] | + | RewriteEngine On |
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} | ||
+ | ... | ||
+ | </code><code> | ||
+ | # service apache2 restart | ||
</code> | </code> | ||
- | |||
==== FreeBSD ==== | ==== FreeBSD ==== | ||
<code> | <code> |