Skip to content

Commit

Permalink
Split .htaccess file to appropriate areas of concern
Browse files Browse the repository at this point in the history
  • Loading branch information
nickcmaynard committed Feb 24, 2017
1 parent c26c4f4 commit e6f038a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ Order Allow,Deny
Deny from all
</Files>

# Old /draftX should go to root
RedirectMatch 301 "^/draft\d[\/]{0,1}$" /

# Serve up everything in dist/
RewriteEngine On
# But not letsencrypt challenge responses!

# Not letsencrypt challenge responses!
RewriteCond %{REQUEST_URI} !^/\.well-known
# Serve up everything in dist/
RewriteRule !^dist(/|$) dist%{REQUEST_URI} [L]

ExpiresActive On
ExpiresDefault "access plus 1 week"
16 changes: 16 additions & 0 deletions www/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Files .htaccess>
Order Allow,Deny
Deny from all
</Files>

RewriteEngine On

# Assumes this directory is deployed at the *root* of the domain
# We need this in case it's being served from a subdirectory (like dist/)
# and the root .htaccess is locally rewriting to it.
RewriteBase /
# Old draftX should be stripped out
RewriteRule "^draft\d[\/]{0,1}$" "" [R]

ExpiresActive On
ExpiresDefault "access plus 1 week"

0 comments on commit e6f038a

Please sign in to comment.