fuzzyworld

fuzzyworld-tools / files / server / site-apps / htaccess

htaccess

Blame: the commit that last changed each line · file · history

f9ca0752 2026-10-27 Pavel Safronov1# apps.fuzzyworld.net. Installed as .htaccess by fuzzyworld-tools (server/install.sh).
2# Every app lives in /<app>/ and is a static build uploaded by `fw deploy`.
3Options -Indexes -Includes -ExecCGI
4DirectoryIndex index.html
5
6RewriteEngine On
7# www.<site> -> <site>, keeping path and query.
8RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
9RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
10
11# engye is hosted on Cloudflare Pages (it needs a Pages Function); keep old paths working.
12RewriteRule ^engye(?:/(.*))?$ https://engye.fuzzyworld.net/$1 [R=301,L]
13
14# Apps are static; nothing here is executed on the server.
15RemoveHandler .php .php3 .php4 .php5 .php7 .php8 .phtml .phar .shtml .cgi .pl .py
16RemoveType .php .php3 .php4 .php5 .php7 .php8 .phtml .phar
17<FilesMatch "\.(php\d?|phtml|phar|shtml|cgi|pl|py|sh)$">
18 Require all denied
19</FilesMatch>
20<Files ".fuzzyworld.json">
21 Require all denied
22</Files>
23
24<IfModule mod_headers.c>
25 Header always set X-Content-Type-Options nosniff
26 Header always set Referrer-Policy strict-origin-when-cross-origin
27 # Entry points must revalidate so a deploy is picked up; hashed build assets never change.
28 <FilesMatch "(\.html|sw\.js|service-worker\.js|\.webmanifest|manifest\.json)$">
29 Header set Cache-Control "no-cache"
30 </FilesMatch>
1758548c 2026-10-27 Pavel Safronov31 # Screenshots from CI runners keep their names when they are retaken.
32 <If "%{REQUEST_URI} =~ m#^/_shots/#">
33 Header set Cache-Control "no-cache"
34 </If>
f9ca0752 2026-10-27 Pavel Safronov35 <If "%{REQUEST_URI} =~ m#^/[^/]+/assets/#">
36 Header set Cache-Control "public, max-age=31536000, immutable"
37 </If>
38</IfModule>