forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
new.htaccess
54 lines (52 loc) · 1.91 KB
/
new.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
# BEGIN Expires Don't forget to enable mod_headers and mod_expires, you can do so by running a2enmod rewrite and a2enmod headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
</ifModule>
# END Expires
# BEGIN Caching
<ifModule mod_headers.c>
Header set Access-Control-Allow-Origin: *
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=216000, public, must-revalidate"
</filesMatch>
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=1, private, must-revalidate"
</filesMatch>
</ifModule>
# END Caching
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [L,QSA]
# from official example
# RewriteEngine on
# RewriteCond %{SCRIPT_FILENAME} !-f
# RewriteCond %{SCRIPT_FILENAME} !-d
# RewriteCond %{SCRIPT_FILENAME} !-l
# RewriteRule ^(.*)$ index.php/$1
</IfModule>
<IfModule mod_xsendfile.c>
RewriteRule ^videos/([A-Za-z0-9-_.]+)$ view/xsendfile.php?file=$1 [QSA]
</IfModule>
<Files routes.php>
Order Allow,Deny
Deny from all
</Files>