Skip to content

Instantly share code, notes, and snippets.

@iraniamir
Last active February 9, 2018 11:58
Show Gist options
  • Save iraniamir/542efea7984bbcb3ccc2315f1d36f46e to your computer and use it in GitHub Desktop.
Save iraniamir/542efea7984bbcb3ccc2315f1d36f46e to your computer and use it in GitHub Desktop.
Serving any spa on apache2
DirectoryIndex /application/index.html
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /application/index.html [L]
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment