-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
100 lines (78 loc) · 2.66 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Set the default handler.
DirectoryIndex index.php index.html index.htm
# Prevent directory listing
Options -Indexes
# Make sure MultiViews is disabled if available.
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<FilesMatch "\.(dist|db|markdown|md|twig|yaml|yml)|(bower|composer|jsdoc|package)\.json$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</FilesMatch>
<FilesMatch "\.(jpg|jpeg)$">
ForceType image/jpeg
</FilesMatch>
<FilesMatch "\.(gif)$">
ForceType image/gif
</FilesMatch>
<FilesMatch "\.(png)$">
ForceType image/png
</FilesMatch>
<FilesMatch "\.(pdf)$">
ForceType application/pdf
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule cache/ - [F]
RewriteBase /
# BOLT STUFF - DO NOT TOUCH
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
### ICCC Stuff - maybe touch ###
# Ensure old rcc/caving links still work
RewriteCond %{REQUEST_URI} ^/caving
RewriteRule ^caving(.*)$ $1 [R=301,NE,L]
RewriteCond %{REQUEST_URI} ^/rcc/caving
RewriteRule ^rcc/caving(.*)$ $1 [R=301,NE,L]
# Ensure old slov links still work
RewriteCond %{REQUEST_URI} ^/slovenia/(page|article)s?/
RewriteRule ^slovenia/(.+?)(?=\.html$|$) /$1 [R=301,L]
# Redirect files, photos, and videos to bolt accessible folder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/FILES/ [OR]
RewriteCond %{REQUEST_URI} ^/photo_archive/ [OR]
RewriteCond %{REQUEST_URI} ^/videos/
RewriteRule ^(.*)$ files/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteCond %{REQUEST_URI} !^/old/
RewriteCond %{REQUEST_URI} !^/files/
RewriteCond %{REQUEST_URI} !^/newzealand/
RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>
# Block access to all hidden files and directories. These types of files
# usually contain user preferences and can include private information like,
# for example, the `.git` or `.svn` directories.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]
</IfModule>
php_value upload_max_filesize 512M
php_value post_max_size 512M
php_value max_execution_time 300
php_value max_input_time 300