From 5d400e87f99fab83b087b367ae55d27edca7b6bf Mon Sep 17 00:00:00 2001 From: denseflux Date: Wed, 20 Dec 2023 23:19:39 +0000 Subject: [PATCH] add some rules to .htaccess --- build/static/.htaccess | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/static/.htaccess b/build/static/.htaccess index 565f663..3090ce5 100644 --- a/build/static/.htaccess +++ b/build/static/.htaccess @@ -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]