htaccess (673B)
1 # SPDX-License-Identifier: AGPL-3.0-or-later
2 # SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de>
3
4 # Set 404 Document
5 ErrorDocument 404 /404.html
6 ErrorDocument 403 /404.html
7
8 # Disallow file browsing
9 Options -Indexes
10
11 # Disallow browsing of certain sub-directories (redirect to 404)
12 RedirectMatch 404 ^/\..*$
13 RedirectMatch 404 ^/bin/.*$
14 RedirectMatch 404 ^/templates/.*$
15 RedirectMatch 404 ^/url$
16 RedirectMatch 404 ^/htaccess$
17
18 # Style filebrowser
19 IndexStyleSheet /assets/index.min.css
20
21 # FileTypes: Treat .sha256 as text file
22 AddType text/plain .sha256
23
24 # Workaround: new directory for private repos
25 RewriteEngine On
26 RewriteRule ^priv(.*)$ /prv$1 [R=301,L]