Answer the question
In order to leave comments, you need to log in
Apache2 rewrite. How to remake?
Good afternoon!
There is a config
<VirtualHost site.ru:80>
ServerAdmin [email protected]
ServerName site.ru
ServerAlias www.site.ru
DocumentRoot /var/www/site.ru/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
<Directory /var/www/site.ru/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
use negation.
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^(www\.|)test\.site\.ru$ [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question