Skip to content

Commit

Permalink
Update htaccess to account for new SvelteKit build output.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Dec 20, 2023
1 parent 6a0e39c commit 44cad39
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions static/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ RewriteRule ^data/.*$ - [L]
# rewrite the broken relative paths that are requested.
RewriteRule ^books/?$ books.html [L]

# Remove the ending trailing slash from any requests to avoid resolving to directory listings
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*?)/$ $1.html
# Redirect any non-directory requests to the name without a trailing slash to avoid resolving to directory listings.
# The rule below will append .html to it.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)/$ $1 [R=301,L]

# Append .html to any requests with or without a trailing slash that resolve to a file with .html.
RewriteCond %{REQUEST_FILENAME}.html -f
Expand Down

0 comments on commit 44cad39

Please sign in to comment.