-
Notifications
You must be signed in to change notification settings - Fork 3
/
.htaccess
61 lines (47 loc) · 1.8 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Asset Caching
<FilesMatch '\.(js|css|jpg|jpeg|png|svg|woff)$'>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 30 days"
</IfModule>
FileETag MTime Size
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
# Version Numbered Filenames
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
# Basic security checks
RewriteRule ^fileadmin/(.*/)?_recycler_/ - [F]
RewriteRule ^fileadmin/templates/.*(\.txt|\.ts)$ - [F]
RewriteRule ^typo3conf/ext/[^/]+/Resources/Private/ - [F]
# Stop rewrite processing, if we are in the typo3/ directory.
RewriteRule ^(typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
# If the file/symlink/directory does not exist => Redirect to index.php.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !/server-status
RewriteRule .* /index.php [L]
# JSON-LD
RewriteCond %{HTTP_ACCEPT} text/json
RewriteCond %{REQUEST_URI} ^/id/(.*)$
RewriteRule id/(.*)$ https://katalogbeta.slub-dresden.de/id/$1.json [R=303,L]
RewriteCond %{HTTP_ACCEPT} application/ld+json
RewriteCond %{REQUEST_URI} ^/id/(.*)$
RewriteRule id/(.*)$ https://katalogbeta.slub-dresden.de/id/$1.json [R=303,L]
RewriteCond %{REQUEST_URI} ^(.*)\.json$
RewriteRule id/(.*)\.json$ http://%{HTTP_HOST}%1/?type=1369315139&tx_find_find\%5Bformat\%5D=data&tx_find_find\%5Bdata-format\%5D=json-ld [P]
</IfModule>
# gzip compression of all assets
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
<FilesMatch "\.(js|css)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 7 days"
</IfModule>
FileETag MTime Size
</FilesMatch>