-
Notifications
You must be signed in to change notification settings - Fork 36
/
.htaccess
116 lines (100 loc) · 4.09 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# DEFAULT CHARSET
AddDefaultCharset utf-8
# PREVENT DIRECTORY LISTING
<IfModule mod_autoindex.c>
#Options -Indexes
</IfModule>
# ADD MIME TYPES
<IfModule mod_mime.c>
AddType image/x-icon .ico
AddType image/svg+xml .svg
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
AddType video/x-flv .flv
AddType audio/mpeg .mp3
AddType audio/ogg .ogg
AddType application/javascript .js
AddType application/json .json
AddType application/xml .xml
AddType application/x-shockwave-flash .swf
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
AddType font/opentype .otf
</IfModule>
# COMPRESS FILES
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE font/opentype
</IfModule>
# ADD CACHING HEADERS
#<IfModule mod_expires.c>
# ExpiresActive On
# ExpiresDefault "access plus 1 week"
# ExpiresByType text/html "access plus 0 seconds"
# ExpiresByType text/plain "access plus 0 seconds"
# ExpiresByType text/xml "access plus 0 seconds"
# ExpiresByType text/css "access plus 4 weeks"
# ExpiresByType image/gif "access plus 1 week"
# ExpiresByType image/png "access plus 1 week"
# ExpiresByType image/jpg "access plus 1 week"
# ExpiresByType image/jpeg "access plus 1 week"
# ExpiresByType image/x-icon "access plus 4 week"
# ExpiresByType image/svg+xml "access plus 4 weeks"
# ExpiresByType video/mp4 "access plus 4 weeks"
# ExpiresByType video/ogg "access plus 4 weeks"
# ExpiresByType video/webm "access plus 4 weeks"
# ExpiresByType video/x-flv "access plus 4 weeks"
# ExpiresByType application/javascript "access plus 4 weeks"
# ExpiresByType application/json "access plus 0 seconds"
# ExpiresByType application/xml "access plus 0 seconds"
# ExpiresByType application/x-shockwave-flash "access plus 4 weeks"
# ExpiresByType application/vnd.ms-fontobject "access plus 4 weeks"
# ExpiresByType application/x-font-ttf "access plus 4 weeks"
# ExpiresByType application/font-woff "access plus 4 weeks"
# ExpiresByType application/font-woff2 "access plus 4 weeks"
# ExpiresByType font/opentype "access plus 4 weeks"
#</IfModule>
# REMOVE ETAG
#<IfModule mod_headers.c>
# Header unset ETag
#</IfModule>
#
#FileETag None
# REWRITING
<IfModule mod_rewrite.c>
# ENABLE REWRITING
RewriteEngine On
# Workaround for RewriteBase
# Copied from https://github.com/symfony/symfony-standard/blob/master/web/.htaccess
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^sitemap\.xml$ %{ENV:BASE}/index.php?rex_yrewrite_func=sitemap [NC,L]
RewriteRule ^robots\.txt$ %{ENV:BASE}/index.php?rex_yrewrite_func=robots [NC,L]
# REWRITE RULE FOR SEO FRIENDLY IMAGE MANAGER URLS
RewriteRule ^mediatypes/([^/]*)/([^/]*) %{ENV:BASE}/index.php?rex_media_type=$1&rex_media_file=$2
RewriteRule ^media/([^/]+)/(.*) %{ENV:BASE}/index.php?rex_media_type=$1&rex_media_file=$2&%{QUERY_STRING} [B]
RewriteRule ^media/(.*) %{ENV:BASE}/index.php?rex_media_type=default&rex_media_file=$1&%{QUERY_STRING} [B]
# deprecated
RewriteRule ^images/([^/]*)/([^/]*) %{ENV:BASE}/index.php?rex_media_type=$1&rex_media_file=$2&%{QUERY_STRING} [B]
RewriteRule ^imagetypes/([^/]*)/([^/]*) %{ENV:BASE}/index.php?rex_media_type=$1&rex_media_file=$2
# existing files will not be overwritten
RewriteCond %{REQUEST_FILENAME} !-f
# existing folders will not be overwritten
RewriteCond %{REQUEST_FILENAME} !-d
# treats symbolic links as pathname
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^/?redaxo/.*$
RewriteRule ^(.*)$ %{ENV:BASE}/index.php?%{QUERY_STRING} [L]
</IfModule>