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
|
# TODO redirect based on language settings
# and the presence of the forum
# for locale redirection
Include conf/vhosts.d/forums.d/*.conf
# Prevent including forum site in tier iframe
Header set X-Frame-Options DENY
# using Redirect create a loop, so we use mod_rewrite here
RewriteEngine On
RewriteRule ^/$ /en/ [R]
RewriteRule ^/(..)$ /$1/ [R]
AliasMatch ^/(..)/(.*) <%= @forums_dir %>/$1/phpBB/$2
<Directory ~ "<%= @forums_dir %>/.*/phpBB/">
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Allow,Deny
Allow from all
</IfModule>
</Directory>
<%-
forbidden = ['install',
'cache',
'includes',
'phpbb_seo/includes',
'store',
'images/avatars/upload',
'files',
'umil/error_files',
'gym_sitemaps/acp',
'gym_sitemaps/sources',
'gym_sitemaps/cache',
'gym_sitemaps/includes',
'gym_sitemaps/display',
'gym_sitemaps/modules',
]
for f in forbidden
-%>
<Directory <%= @forums_dir %>/.*/phpBB/<%= @f %>/ >
<IfModule mod_authz_core.c>
# Apache 2.4
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from all
</IfModule>
</Directory>
<%- end -%>
|