add possibility to https

This commit is contained in:
rnsrk 2021-09-28 10:18:27 +02:00
parent abba49a635
commit bd02b48507
2 changed files with 238 additions and 96 deletions

37
example-ssl.conf Normal file
View file

@ -0,0 +1,37 @@
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin <your email>
ServerName www.<your website>
ServerAlias <your website>
DocumentRoot /var/www/html/<your website>/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile <path to SSLCertificateFile.pem>
SSLCertificateKeyFile <path to SSLCertificateKeyFile.key>
# Depending on your provider, you may not need a SSLCertificateChainFile
# SSLCertificateChainFile <path to SSLCertificateChainFile.crt>
# Rewrite rule to redirect www.<your website> to <your website>
# RewriteEngine on
# RewriteCond %{SERVER_NAME} =<your website>
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
# OR
# Rewrite rule to redirect <your website> to www.<your website>
# RewriteEngine on
# RewriteCond %{SERVER_NAME} =example.com
# RewriteRule ^ https://www.%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent
<Directory /var/www/html/<your website>/web>
Options FollowSymlinks
AllowOverride All
Require all granted
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q= [L,QSA]
</Directory>
</VirtualHost>
</IfModule>