Last active
August 29, 2015 14:23
-
-
Save jordansaints/b16919de70338650765e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Apache directives for serving a javascript application. | |
# Requests that don't match a file or directory are served | |
# the index.html file so that your javascript router may load | |
# and handle the requested route. | |
# by Jordan Saints, www.jordansaints.com | |
# | |
# Optional, easier than sudo copying your app to your DocumentRoot. | |
Alias /app /path/to/your/app | |
<Directory "/path/to/your/app"> | |
AllowOverride None | |
Options Indexes FollowSymLinks | |
Require all granted | |
RewriteEngine On | |
RewriteBase / | |
# rewrite is conditional on request not being a file (-f) or a dir (-d) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /app/index.html [L,QSA,NC,NE] | |
# NC - ignore case comparison | |
# NE - do not encode RHS URI | |
# QSA - append exisiting query string into new one | |
# L - mark as last rule | |
</Directory> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment