Simply add those rules into domain.conf file on this path: /home/someUser/conf/web/sapache2.domain.com.conf
It will work straight out of the box thanks to this code-line: https://github.com/myvesta/vesta/blob/3 ... 4.stpl#L41
For example:
Code: Select all
cd /home/someUser/conf/web
Code: Select all
mcedit sapache2.mydomain.com.conf
Code: Select all
RewriteEngine on
# always redirect to https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# always redirect to www.
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Code: Select all
ln -s sapache2.mydomain.com.conf apache2.mydomain.com.conf
Code: Select all
systemctl restart apache2