-
Notifications
You must be signed in to change notification settings - Fork 11
/
.htaccess
70 lines (58 loc) · 3.21 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
# <contrexx>
# <core_routing>
RewriteEngine On
# Set the path, relative from the document root, to Contrexx.
# Technical note: This is ASCMS_PATH_OFFSET
# I.e.: /
RewriteBase /
# Strip virtual language directory for MEDIA RESSOURCES, CONTENT DATA and THEME
# IMPORTANT: When running Contrexx in a subdirectory (relativ to the webserver's DocumentRoot)
# then you'll have to comment-out the following ruleset
RewriteCond %{REQUEST_URI} ^/\w+/(core|core_modules|lib|modules|feed|media|images|themes)/
RewriteRule ^\w+\/(.*)$ /$1 [L]
# Deny direct access to directories containing sensitive data
RewriteCond %{ENV:REDIRECT_END} !1
RewriteCond %{REQUEST_URI} ^/(config|tmp(?!/public)|websites|core\/.*/Data|core_modules\/.*\/Data|modules\/.*\/Data)/
RewriteRule . - [F]
# Deny access to debug log
RewriteCond %{REQUEST_URI} ^/dbg\.log
RewriteRule . - [F]
# MultiSite: Map requests to MEDIA RESOURCES of the Code Base of a Website
RewriteCond %{ENV:REDIRECT_END} !1
RewriteCond %{REQUEST_URI} ^/(core|core_modules|lib|modules)/
RewriteRule (.*) ${websiteDomainCodeBaseMap:%{HTTP_HOST}|}/$1 [L,QSA,E=END:1]
# MultiSite: Map requests to CONTENT DATA of a Website
RewriteCond %{ENV:REDIRECT_END} !1
RewriteCond %{REQUEST_URI} ^/(feed\/|media\/|images\/|tmp\/public\/|robots\.txt|sitemap_\w+\.xml)
RewriteRule (.*) ${websiteDomainContentMap:%{HTTP_HOST}|}/$1 [L,QSA,E=END:1]
# MultiSite: Try to map the request of a webdesign template file to the
# website's data repository.
# Replace '%PATH_DOCUMENT_ROOT%' by the absolute path to the
# document root of the Contrexx installation. I.e.: /var/www
RewriteCond %{ENV:REDIRECT_END} !1
RewriteCond %{REQUEST_URI} ^/(themes)/
RewriteCond %PATH_DOCUMENT_ROOT%${websiteDomainContentMap:%{HTTP_HOST}}%{REQUEST_URI} -f
RewriteRule (.*) ${websiteDomainContentMap:%{HTTP_HOST}|}/$1 [L,QSA,E=END:1]
# MultiSite: Try to map the request of a the webdesign template file to
# the website's Code Base.
# Replace '%PATH_DOCUMENT_ROOT%' by the absolute path to the
# document root of the Contrexx installation. I.e.: /var/www
RewriteCond %{ENV:REDIRECT_END} !1
RewriteCond %{REQUEST_URI} ^/(themes)/
RewriteCond %PATH_DOCUMENT_ROOT%${websiteDomainCodeBaseMap:%{HTTP_HOST}}%{REQUEST_URI} -f
RewriteRule (.*) ${websiteDomainCodeBaseMap:%{HTTP_HOST}|}/$1 [L,QSA,E=END:1]
# Resolve language specific sitemap.xml
RewriteCond %{ENV:REDIRECT_END} !1
RewriteRule ^(\w+)\/sitemap.xml$ ${websiteDomainContentMap:%{HTTP_HOST}|}/sitemap_$1.xml [L,NC,E=END:1]
# Allow directory index files
RewriteCond %{REQUEST_FILENAME}/index.php -f
RewriteRule . %{REQUEST_URI}/index.php [L,QSA]
# Redirect all requests to non-existing files to Contrexx,
# except for media resources
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.*\.(gif|jpg|png|bmp|js|css|woff|ttf|svg)$
RewriteRule . index.php?__cap=%{REQUEST_URI} [L,QSA]
# Add captured request to index files
RewriteRule ^index.php index.php?__cap=%{REQUEST_URI} [L,QSA]
# </core_routing>
# </contrexx>