<VirtualHost *:80>
ServerName www.scummvm.org
ServerAlias scummvm.org
Redirect permanent / https://www.scummvm.org/
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.scummvm.org [OR]
RewriteCond %{SERVER_NAME} =scummvm.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
ServerAdmin webmaster@scummvm.org
ServerName www.scummvm.org
ServerAlias scummvm.org
DocumentRoot /var/www/scummvm-web/public_html

<If "%{HTTP_HOST} !~ /^www\./">
Redirect permanent / https://www.scummvm.org/
</If>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

DirectoryIndex index.php
FallbackResource /index.php

<Directory /var/www/scummvm-web/public_html>
  Include /etc/apache2/conf-fragments/scummvm-rewrite.conf
</Directory>

#Alias /frs /.0/frs
Alias /old /var/www/scummvm-web-old

# Admin
Include /etc/apache2/conf-fragments/scummvm-admin.conf

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/scummvm.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/scummvm.org/privkey.pem

# Caching
ExpiresActive On
ExpiresByType image/gif "modification plus 1 year"
ExpiresByType image/ico "modification plus 1 year"
ExpiresByType image/jpeg "modification plus 1 year"
ExpiresByType image/jpg "modification plus 1 year"
ExpiresByType image/png "modification plus 1 year"
ExpiresByType text/css "modification plus 1 month"
ExpiresByType text/javascript "modification plus 1 month"
ExpiresByType application/x-javascript "modification plus 1 month"
ExpiresByType application/javascript "modification plus 1 month"

</VirtualHost>
