This repository has been archived by the owner on Jan 6, 2020. It is now read-only.
forked from fossar/selfoss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
81 lines (65 loc) · 2.4 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
#AddHandler php53-cgi .php
# Enable rewrite engine and route requests to framework
RewriteEngine On
#RewriteBase /selfoss
# rule for favicons
RewriteRule !data/favicons/(.*)$ - [C]
RewriteRule favicons/(.*)$ data/favicons/$1 [L]
# rule for thumbnails
RewriteRule !data/thumbnails/(.*)$ - [C]
RewriteRule thumbnails/(.*)$ data/thumbnails/$1 [L]
# rule for front controller
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule !.(js|ico|gif|jpg|png|css|asc|txt|eot|woff|ttf|ttf|svg)$ index.php?%1
# rule for files
RewriteRule !favicons/ - [C]
RewriteRule !thumbnails - [C]
RewriteRule !public - [C]
RewriteRule !index.php - [C]
RewriteRule (.*) public/$1 [L]
# deny requests for config files
<FilesMatch ".(ini)$">
Order allow,deny
Deny from all
</FilesMatch>
# Disable ETags
<IfModule mod_headers.c>
Header Unset ETag
FileETag none
</IfModule>
# Default expires header if none specified (stay in browser cache for 7 days)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A604800
ExpiresByType application/javascript "access plus 2 hours"
ExpiresByType application/x-javascript "access plus 2 hours"
ExpiresByType text/javascript "access plus 2 hours"
ExpiresByType text/x-javascript "access plus 2 hours"
ExpiresByType text/css "access plus 2 hours"
ExpiresByType image/gif "access plus 2 hours"
ExpiresByType image/jpg "access plus 2 hours"
ExpiresByType image/png "access plus 2 hours"
ExpiresByType image/x-icon "access plus 2 hours"
</IfModule>
# set compression
<IfModule mod_header.c>
<IfModule mod_deflate.c>
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>