forked from crosswalk-project/crosswalk-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.conf
110 lines (92 loc) · 3.96 KB
/
site.conf
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
Alias /crosswalk-website "/home/me/dev/crosswalk-website"
<IfModule mod_env.c>
# uncomment this line if your sass script is on a path inaccessible
# to the Apache user
#SetEnv SASS /usr/local/bin/sass
</IfModule>
<DirectoryMatch "^\..*$">
Require all denied
</DirectoryMatch>
<Directory "/home/me/dev/crosswalk-website">
AllowOverride None
Require all granted
Options +FollowSymLinks -Indexes
<FilesMatch "\.(engine|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(|~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
Require all denied
</FilesMatch>
DirectoryIndex index.html
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
php_flag magic_quotes_sybase off
php_flag register_globals off
php_flag session.auto_start off
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_flag mbstring.encoding_translation off
</IfModule>
# caching
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 0.5 days after access (A).
ExpiresDefault A43200
<FilesMatch \.php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
</FilesMatch>
</IfModule>
# rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
# uncomment the line below to turn on rewrite logging
#LogLevel alert rewrite:trace8
# If a requested file has a php version, serve the php version
# instead which will update and serve a cached version as necessary.
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^[^/]*(.*)$ %{REQUEST_URI}$1.php [L]
# Set "protossl" to "s" if we were accessed via https://. This is used later
# if you enable "www." stripping or enforcement, in order to ensure that
# you don't bounce between http and https.
RewriteRule ^ - [E=protossl]
RewriteCond %{HTTPS} on
RewriteRule ^ - [E=protossl:s]
# The rewrites below take into account possible
# mod_userdir expansion by rewriting the URL to be
# based on the absolute path %{REQUEST_URI}
#
# The ../ request is because REQUEST_URI will
# include the full filepath, including filename; the
# .. strips that
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteRule ^(.*)$ /crosswalk-website/gfm.php?f=$1 [L,NS]
# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
<IfModule mod_headers.c>
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
# Serve gzip compressed JS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$">
# Serve correct encoding type.
Header set Content-Encoding gzip
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
</IfModule>
</Directory>