forked from amyjko/faculty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
35 lines (27 loc) · 1.47 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ExpiresActive On
ExpiresDefault "access"
# Support cache manifest for the Budget app.
AddType text/cache-manifest .manifest
# Rewrite any non-existent files and directories to the index.html file, allowing
# our single page web app to do the routing on the front end.
# Turn the rewrite engine on.
RewriteEngine On
# Set the path to prepend to all rewrites.
RewriteBase /ajko
# If we're processing index.html, leave it alone and stop.
RewriteRule ^index\.html$ - [L]
# Need an explicit rule to redirect the books directory to the app, otherwise we get the Apache directory listing.
# But we don't want to match anything inside the directory since we don't use the app for the books.
# Moreover, the redirect rule breaks the relative paths in index.html, so we need to explicitly
# rewrite the broken relative paths that are requested.
RewriteRule ^books/?$ index.html [L]
# Since this htaccess files applies to any subdirectory, even ones that don't exist,
# make sure any path pointing to app.js or custom.css always points to the one in the root, not a path
# in any subdirectories. This works around the problem that HTML doesn't allow us to refer to a base
# directory on the server.
RewriteRule ^.*app\.js$ build/app.js [L]
RewriteRule ^.*custom\.css$ custom.css [L]
# If we're processing a path that isn't a real file or a directory, rewrite to index but preserve the query string.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html [L,QSA]