forked from contao/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess.default
187 lines (162 loc) · 5.43 KB
/
.htaccess.default
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
##
# Contao Open Source CMS
# Copyright (C) 2005-2012 Leo Feyer
#
# Formerly known as TYPOlight Open Source CMS.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program. If not, please visit the Free
# Software Foundation website at <http://www.gnu.org/licenses/>.
#
# PHP version 5
# @copyright Leo Feyer 2005-2012
# @author Leo Feyer <http://www.contao.org>
# @license LGPL
##
##
# Disable ETags
# @see http://developer.yahoo.com/performance/rules.html#etags
##
FileETag None
##
# Prevent access to the Contao template files
##
<FilesMatch "\.(tpl|html5|xhtml)$">
Order allow,deny
Deny from all
</FilesMatch>
<IfModule mod_mime.c>
##
# Serve the correct content type for .htc files (CSS3 PIE)
# @see http://css3pie.com/documentation/known-issues/#content-type
##
AddType text/x-component .htc
</IfModule>
<IfModule mod_deflate.c>
##
# Use mod_deflate to compress JavaScript, CSS, XML, HTML and PHP files.
# @see http://developer.yahoo.com/performance/rules.html#gzip
##
<FilesMatch "\.(css|js|xml|html?|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
<IfModule mod_headers.c>
##
# Disable ETags
# @see http://developer.yahoo.com/performance/rules.html#etags
##
Header unset ETag
##
# Add a Vary Accept-Encoding header for the compressed resources. If you
# modify the file types above, make sure to change them here accordingly.
# @see http://developer.yahoo.com/performance/rules.html#gzip
##
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
##
# Activate the module
##
ExpiresActive On
##
# Specify an expiration 30 days in the future for images, JavaScripts and
# CSS files. Edit or remove the lines to set up your own expiration logic.
# @see http://developer.yahoo.com/performance/rules.html#expires
##
ExpiresByType image/png A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/x-icon A2592000
</IfModule>
<IfModule mod_rewrite.c>
##
# Activate the module
##
RewriteEngine On
##
# Change the RewriteBase if your Contao installation is in a subdirectoy and
# the rewrite rules are not working properly. Usage examples:
#
# RewriteBase /contao-3.0.0
# RewriteBase /path/to/contao
#
# Depending on your server, you might have to remove the line entirely.
##
RewriteBase /
##
# Uncomment the following lines and replace "domain.com" with your domain
# name to redirect requests without "www" to the correct domain.
##
#RewriteCond %{HTTP_HOST} ^domain\.com [NC]
#RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
##
# If you cannot use mod_deflate, uncomment the following lines to load a
# compressed .gz version of the aggregated Contao JavaScript and CSS files.
##
#AddEncoding gzip .gz
#<FilesMatch "\.js\.gz$">
# AddType "text/javascript" .gz
#</FilesMatch>
#<FilesMatch "\.css\.gz$">
# AddType "text/css" .gz
#</FilesMatch>
#RewriteCond %{HTTP:Accept-encoding} gzip
#RewriteCond %{REQUEST_FILENAME} \.(js|css)$
#RewriteCond %{REQUEST_FILENAME}.gz -f
#RewriteRule ^(.*)$ $1.gz [QSA,L]
##
# Do not rewrite requests for static files or folders such as style sheets,
# images, movies or text documents. Do not add the URL suffix here!
##
<FilesMatch "\.(htm|php|js|css|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|eot|woff|svg|ttf|pdf|gz)$">
RewriteEngine Off
</FilesMatch>
##
# By default, Contao adds ".html" to the generated URLs to simulate static
# HTML documents. If you change the URL suffix in the back end settings, make
# sure to change it here accordingly!
#
# RewriteRule .*\.html$ index.php [L] # URL suffix .html
# RewriteRule .*\.txt$ index.php [L] # URL suffix .txt
# RewriteRule .*\.json$ index.php [L] # URL suffix .json
#
# If you do not want to use an URL suffix at all, you have to add a second
# line to prevent URLs that point to folders from being rewritten (see #4031).
#
# RewriteCond %{REQUEST_FILENAME} !-d
#
# If you are using mod_cache, it is recommended to use the RewriteRule below,
# which adds the query string to the internal URL:
#
# RewriteRule (.*\.html)$ index.php/$1 [L]
#
# Note that not all environments support mod_rewrite and mod_cache.
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*\.html$ index.php [L]
##
# The following rules are required if you want to pass the language as first
# URL parameter (added in Contao 2.11). The first rule rewrites an empty URL
# to the front end controller, the second one adds a missing trailing slash.
##
RewriteRule ^[a-z]{2}/$ index.php [L]
RewriteRule ^([a-z]{2})$ $1/ [R=301,L]
</IfModule>