Skip to content

Instantly share code, notes, and snippets.

@makmac213
Created August 6, 2015 10:57
Show Gist options
  • Save makmac213/cf8c0df8ca9c19ccd77b to your computer and use it in GitHub Desktop.
Save makmac213/cf8c0df8ca9c19ccd77b to your computer and use it in GitHub Desktop.
Apache - Permanent redirect and browser caching
<VirtualHost *:80>
ServerName example.com
Redirect permanent / http://www.example.com/
</VirtualHost>
<VirtualHost *:80>
ServerName www.example.com
<Directory /home/ubuntu/public_html/example/example/>
Require all granted
</Directory>
WSGIScriptAlias / /home/ubuntu/public_html/example/example/example/wsgi.py
Alias /static/ /home/ubuntu/public_html/example/example/assets/
Alias /media/ /home/ubuntu/public_html/example/example/media/
ExpiresActive on
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment