Skip to content

Commit

Permalink
add some rules to .htaccess
Browse files Browse the repository at this point in the history
  • Loading branch information
denseflux committed Dec 20, 2023
1 parent b8ab78e commit 5d400e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/static/.htaccess
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
RewriteEngine On

# a rewrite rule that changes /api/files/?item=234 into /api/files/234

RewriteCond %{QUERY_STRING} ^item=(\d+)$
RewriteRule ^api/files/$ /api/files/%1 [R=302,L]
RewriteRule ^api/files/$ /api/items/%1? [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/api/files
RewriteCond %{REQUEST_URI} !^/api/items
RewriteRule ^(.*)$ $1.html [L]

0 comments on commit 5d400e8

Please sign in to comment.