Skip to content

Instantly share code, notes, and snippets.

@notcod
Last active February 19, 2023 16:24
Show Gist options
  • Select an option

  • Save notcod/de71ec97af690ff1a48dab2b265bb828 to your computer and use it in GitHub Desktop.

Select an option

Save notcod/de71ec97af690ff1a48dab2b265bb828 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
ServerName default.example.com
Redirect permanent / https://default.example.com/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@default.example.com
ServerName default.example.com
DocumentRoot /var/www/default
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/default>
RewriteEngine On
RewriteCond %{REQUEST_URI} !/public/.*
RewriteCond %{REQUEST_URI} ^.*\.(json|png|gif|ico|jpg|jpeg|pdf|map|svg|css|js|txt|xml|ttf|eot|woff|woff2|mp4)$ [NC]
RewriteRule ^(.*)$ public/$1 [NC,L,QSA]
RewriteEngine On
RewriteCond %{REQUEST_URI} !.*\.(json|png|gif|ico|jpg|jpeg|pdf|map|svg|css|js|txt|xml|ttf|eot|woff|woff2|mp4)$ [NC]
RewriteRule ^(.*)$ index.php?URL=$1 [NC,L,QSA]
</Directory>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/default.pem
SSLCertificateKeyFile /etc/apache2/ssl/default.key
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment