-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.htaccess
73 lines (56 loc) · 2.08 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
61
62
63
64
65
66
67
68
69
70
71
72
ErrorDocument 403 /error403
ErrorDocument 404 /error404
ErrorDocument 503 /error503
<FilesMatch "^[^.]+$">
ForceType application/x-httpd-php
</FilesMatch>
<FilesMatch "\.php$">
Order Deny,Allow
Deny from All
</FilesMatch>
# Cache immutable when t parameter is present, else no-cache
RewriteCond %{QUERY_STRING} (^|&)t= [NC]
RewriteRule \.(css|js)$ - [E=CACHE_CONTROL:immutable]
<FilesMatch "\.(css|js)$">
Header set Cache-Control "public, max-age=31536000, immutable" env=CACHE_CONTROL
# When using mod_deflate, Apache refuses to send 304s with ETags
# https://scarff.id.au/blog/2009/apache-304-and-mod_deflate-revisited/
FileEtag None
</FilesMatch>
<FilesMatch "\.(css|js)$">
Header set Cache-Control "public, no-cache" env=!CACHE_CONTROL
FileETag None
</FilesMatch>
RewriteEngine on
Options FollowSymLinks
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^ifdb.tads.org$
RewriteRule ^(google7f64b84ffa585e59.html)$ $1 [L,NE]
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} !^ifdb.org$
RewriteCond %{HTTP_HOST} !^dev.ifdb.org$
RewriteRule ^(.*)$ https://ifdb.org/$1 [L,R=301,NE]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^ifdb.org$ [OR]
RewriteCond %{HTTP_HOST} \.ifdb.org$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
#Uncomment to enable maintenance mode
#RewriteCond %{REQUEST_URI} "!/error503"
#RewriteRule .* - [R=503,L]
RewriteRule ^$ home [L]
RewriteRule ^index$ home [L]
RewriteRule ^index\.htm$ home [L]
RewriteRule ^index\.html$ home [L]
RewriteRule ^api/$ /api/index [END]
RewriteRule ^api/index$ /api/ [L,R=301]
RewriteRule ^dla-zoom/([a-z0-9]+)/[^/]+\.signpost$ /dladviser?id=$1&xml&os=MacOSX [L]
RewriteRule ^users/([a-z0-9]+)/(.+)$ /userfile?u=$1&f=$2 [L]
RewriteRule ^t3file/([a-z0-9]+)/(.+)$ /t3files?download=$1/$2 [L]
RewriteRule ^images/(.*)$ /img/$1 [L,R=301,NE]
RewriteRule ^dark-images/(.*)$ /img/dark-images/$1 [L,R=301,NE]
RewriteRule ^([^/]*)\.(gif|jpg|png)$ /img/$1.$2 [L,R=301,NE]
#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^login$ mylogin [R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /error404 [L]