author | ymh <ymh.work@gmail.com> |
Mon, 19 Mar 2018 16:00:44 +0100 | |
changeset 570 | cdf0cb7bf073 |
parent 541 | e756a8c72c3d |
permissions | -rwxr-xr-x |
541
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
# Apache/PHP/Drupal settings: |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
# Protect files and directories from prying eyes. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$"> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
<IfModule mod_authz_core.c> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
Require all denied |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
</IfModule> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
<IfModule !mod_authz_core.c> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
Order allow,deny |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
</IfModule> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
</FilesMatch> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
# Don't show directory listings for URLs which map to a directory. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
Options -Indexes |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
# Follow symbolic links in this directory. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
Options +FollowSymLinks |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
# Make Drupal handle any 404 errors. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
ErrorDocument 404 /index.php |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
# Set the default handler. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
DirectoryIndex index.php index.html index.htm |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
# Override PHP settings that cannot be changed at runtime. See |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
# sites/default/default.settings.php and drupal_environment_initialize() in |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
# includes/bootstrap.inc for settings that can be changed at runtime. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
# PHP 5, Apache 1 and 2. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
<IfModule mod_php5.c> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
php_flag magic_quotes_gpc off |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
php_flag magic_quotes_sybase off |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
php_flag register_globals off |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
php_flag session.auto_start off |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
php_value mbstring.http_input pass |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
php_value mbstring.http_output pass |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
php_flag mbstring.encoding_translation off |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
</IfModule> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
# Requires mod_expires to be enabled. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
<IfModule mod_expires.c> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
# Enable expirations. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
ExpiresActive On |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
# Cache all files for 2 weeks after access (A). |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
ExpiresDefault A1209600 |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
<FilesMatch \.php$> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
51 |
# Do not allow PHP scripts to be cached unless they explicitly send cache |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
# headers themselves. Otherwise all scripts would have to overwrite the |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
# headers set by mod_expires if they want another caching behavior. This may |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
# fail if an error occurs early in the bootstrap process, and it may cause |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
# problems if a non-Drupal PHP file is installed in a subdirectory. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
ExpiresActive Off |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
</FilesMatch> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
</IfModule> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
60 |
# Various rewrite rules. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
61 |
<IfModule mod_rewrite.c> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
62 |
RewriteEngine on |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
64 |
# Set "protossl" to "s" if we were accessed via https://. This is used later |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
# if you enable "www." stripping or enforcement, in order to ensure that |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
66 |
# you don't bounce between http and https. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
RewriteRule ^ - [E=protossl] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
RewriteCond %{HTTPS} on |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
RewriteRule ^ - [E=protossl:s] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
# Make sure Authorization HTTP header is available to PHP |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
# even when running as CGI or FastCGI. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
# Block access to "hidden" directories whose names begin with a period. This |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
76 |
# includes directories used by version control systems such as Subversion or |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
77 |
# Git to store control files. Files whose names begin with a period, as well |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
# as the control files used by CVS, are protected by the FilesMatch directive |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
# above. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
80 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
# NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
# not possible to block access to entire directories from .htaccess, because |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
# <DirectoryMatch> is not allowed here. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
85 |
# If you do not have mod_rewrite installed, you should remove these |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
86 |
# directories from your webroot or otherwise protect them from being |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
# downloaded. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
RewriteRule "/\.|^\.(?!well-known/)" - [F] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
# If your site can be accessed both with and without the 'www.' prefix, you |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
# can use one of the following settings to redirect users to your preferred |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
93 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
94 |
# To redirect all users to access the site WITH the 'www.' prefix, |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
95 |
# (http://example.com/... will be redirected to http://www.example.com/...) |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
# uncomment the following: |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
97 |
# RewriteCond %{HTTP_HOST} . |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
98 |
# RewriteCond %{HTTP_HOST} !^www\. [NC] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
# RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
# To redirect all users to access the site WITHOUT the 'www.' prefix, |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
# (http://www.example.com/... will be redirected to http://example.com/...) |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
103 |
# uncomment the following: |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
104 |
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
# RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
106 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
107 |
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
108 |
# VirtualDocumentRoot and the rewrite rules are not working properly. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
109 |
# For example if your site is at http://example.com/drupal uncomment and |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
110 |
# modify the following line: |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
111 |
# RewriteBase /drupal |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
112 |
# |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
113 |
# If your site is running in a VirtualDocumentRoot at http://example.com/, |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
114 |
# uncomment the following line: |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
115 |
# RewriteBase / |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
117 |
# Pass all requests not referring directly to files in the filesystem to |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
118 |
# index.php. Clean URLs are handled in drupal_environment_initialize(). |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
RewriteCond %{REQUEST_FILENAME} !-f |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
120 |
RewriteCond %{REQUEST_FILENAME} !-d |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
121 |
RewriteCond %{REQUEST_URI} !=/favicon.ico |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
122 |
RewriteRule ^ index.php [L] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
123 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
124 |
# Rules to correctly serve gzip compressed CSS and JS files. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
125 |
# Requires both mod_rewrite and mod_headers to be enabled. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
126 |
<IfModule mod_headers.c> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
127 |
# Serve gzip compressed CSS files if they exist and the client accepts gzip. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
128 |
RewriteCond %{HTTP:Accept-encoding} gzip |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
129 |
RewriteCond %{REQUEST_FILENAME}\.gz -s |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
130 |
RewriteRule ^(.*)\.css $1\.css\.gz [QSA] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
131 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
132 |
# Serve gzip compressed JS files if they exist and the client accepts gzip. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
133 |
RewriteCond %{HTTP:Accept-encoding} gzip |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
134 |
RewriteCond %{REQUEST_FILENAME}\.gz -s |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
135 |
RewriteRule ^(.*)\.js $1\.js\.gz [QSA] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
136 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
137 |
# Serve correct content types, and prevent mod_deflate double gzip. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
138 |
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
139 |
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1] |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
140 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
141 |
<FilesMatch "(\.js\.gz|\.css\.gz)$"> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
142 |
# Serve correct encoding type. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
143 |
Header set Content-Encoding gzip |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
144 |
# Force proxies to cache gzipped & non-gzipped css/js files separately. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
145 |
Header append Vary Accept-Encoding |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
146 |
</FilesMatch> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
147 |
</IfModule> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
148 |
</IfModule> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
149 |
|
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
150 |
# Add headers to all responses. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
151 |
<IfModule mod_headers.c> |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
152 |
# Disable content sniffing, since it's an attack vector. |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
153 |
Header always set X-Content-Type-Options nosniff |
e756a8c72c3d
integrate drupal and correct build process. update version
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
154 |
</IfModule> |
570
cdf0cb7bf073
update drupal cms after security audit
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
155 |
|
cdf0cb7bf073
update drupal cms after security audit
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
156 |
<Files "xmlrpc.php"> |
cdf0cb7bf073
update drupal cms after security audit
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
157 |
Order Deny,Allow |
cdf0cb7bf073
update drupal cms after security audit
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
158 |
Deny from all |
cdf0cb7bf073
update drupal cms after security audit
ymh <ymh.work@gmail.com>
parents:
541
diff
changeset
|
159 |
</Files> |