-
Notifications
You must be signed in to change notification settings - Fork 25
/
sample.htaccess
116 lines (100 loc) · 4.21 KB
/
sample.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
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>
<Files web.config>
Order deny,allow
Deny from all
</Files>
# This denies access to all yml files, since developers might include sensitive
# information in them. See the docs for work-arounds to serve some yaml files
<Files *.yml>
Order allow,deny
Deny from all
</Files>
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html
ErrorDocument 400 /assets/error-400.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase '/'
RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]
# custom rules
### These two rules added to make www canonical ###
# RewriteCond %{HTTP_HOST} !^www\.openstack\.org$ [NC]
# RewriteCond %{HTTP_HOST} !^direct\.openstack\.org$ [NC]
# RewriteRule ^(.*)$ http://www.openstack.org/$1 [R=301,L]
# Hide robots.txt for the www domain, but show it otherwise
# (so that crawlers don't index our subdomain which bypasses the CDN).
# RewriteCond %{HTTP_HOST} !^www\.openstack\.org$ [NC]
# RewriteCond %{REQUEST_URI} ^/robots.txt$ [NC]
# RewriteRule robots.txt robots_for_direct.txt [L]
RewriteRule ^(blog) - [L]
RewriteRule ^(chat) - [L]
#old training url format must redirect to new format
RewriteCond %{REQUEST_URI} marketplace/training/company/(.*)
RewriteRule ^marketplace/training/company/(.*)$ http://%{HTTP_HOST}/marketplace/training/$1 [R,L]
#RewriteCond %{REQUEST_URI} !/maintenance/index.html$ [NC]
#RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
#RewriteRule .* /maintenance/index.html [R=302,L]
#SS3
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.php$
RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###
php_value memory_limit 512M
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_value error_reporting 30711
### http://httpd.apache.org/docs/2.2/mod/mod_expires.html
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/ico "access plus 1 year"
ExpiresByType text/css "access plus 24 hours"
ExpiresByType text/javascript "access plus 24 hours"
ExpiresByType application/x-javascript "access plus 24 hours"
ExpiresByType application/pdf "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access plus 1 year"
ExpiresByType audio/x-wav "access plus 1 year"
ExpiresByType audio/mpeg "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/quicktime "access plus 1 year"
ExpiresByType video/x-ms-wmv "access plus 1 year"
</IfModule>
## dont send server info
<IfModule mod_headers.c>
Header unset Server
Header unset X-Powered-By
</IfModule>
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images, movies or zip files
## images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|svg|ico|bmp|pcx|tif|alpha|als|cel|icon|ps)$ no-gzip dont-vary
## zip
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|arc|tar|dmg|jar|ace|arj|cab)$ no-gzip dont-vary
## movies
SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|mp4|rm|flv|swf|mp?g|mpeg|m1v|mp2|mpa|mpe|ifo|vob|wmv|asf|m2v|qt|ogv|webm)$ no-gzip dont-vary
## docs
SetEnvIfNoCase Request_URI \.(?:pdf|doc|docx|xls|xlsx|csv|key|ppt|pptx|ai|txt|rtf|pages|pps)$ no-gzip dont-vary
<IfModule mod_headers.c>
# properly handle requests coming from behind proxies
Header append Vary User-Agent
</IfModule>
</IfModule>