html5-boilerplate 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +11 -18
- data/VERSION +1 -1
- data/stylesheets/html5-boilerplate/_fonts.scss +1 -7
- data/stylesheets/html5-boilerplate/_helpers.scss +2 -4
- data/stylesheets/html5-boilerplate/_media.scss +8 -7
- data/stylesheets/html5-boilerplate/_reset.scss +7 -17
- data/stylesheets/html5-boilerplate/_styles.scss +9 -12
- data/templates/project/_head.html.haml +3 -8
- data/templates/project/_javascripts.html.haml +8 -11
- data/templates/project/application.html.haml +3 -3
- data/templates/project/files/htaccess +194 -19
- data/templates/project/files/humans.txt +43 -0
- data/templates/project/index.html.haml +4 -13
- data/templates/project/javascripts/plugins.js +3 -32
- data/templates/project/javascripts/rails.js +137 -156
- data/templates/project/javascripts/script.js +26 -0
- data/templates/project/manifest.rb +8 -15
- data/templates/project/partials/_base.scss +1 -1
- data/templates/project/partials/_example.scss +0 -21
- data/templates/project/partials/_fonts.scss +4 -0
- data/templates/project/partials/_media.scss +21 -0
- data/templates/project/style.scss +14 -9
- metadata +8 -12
- data/templates/project/files/lighttpd.conf +0 -149
- data/templates/project/files/mime.types +0 -80
- data/templates/project/files/nginx.conf +0 -108
- data/templates/project/files/web.config +0 -207
- data/templates/project/javascripts/profiling/charts.swf +0 -0
- data/templates/project/javascripts/profiling/config.js +0 -59
- data/templates/project/javascripts/profiling/yahoo-profiling.css +0 -7
- data/templates/project/javascripts/profiling/yahoo-profiling.min.js +0 -39
data/README.md
CHANGED
@@ -31,29 +31,26 @@ Rails Installation
|
|
31
31
|
app/stylesheets/partials/_base.scss
|
32
32
|
app/stylesheets/partials/_example.scss
|
33
33
|
app/stylesheets/partials/_page.scss
|
34
|
+
app/stylesheets/partials/_fonts.scss
|
35
|
+
app/stylesheets/partials/_media.scss
|
34
36
|
|
35
37
|
public/404.html
|
36
38
|
public/.htaccess
|
37
39
|
public/crossdomain.xml
|
38
40
|
public/robots.txt
|
41
|
+
public/humans.txt
|
39
42
|
public/apple-touch-icon.png
|
40
43
|
public/favicon.ico
|
41
44
|
|
42
45
|
public/javascripts/dd_belatedpng.js
|
43
|
-
public/javascripts/jquery
|
44
|
-
public/javascripts/modernizr
|
46
|
+
public/javascripts/jquery.min.js
|
47
|
+
public/javascripts/modernizr.min.js
|
45
48
|
public/javascripts/plugins.js
|
46
49
|
public/javascripts/rails.js
|
47
|
-
public/javascripts/profiling/charts.swf
|
48
|
-
public/javascripts/profiling/config.js
|
49
|
-
public/javascripts/profiling/yahoo-profiling.css
|
50
|
-
public/javascripts/profiling/yahoo-profiling.min.js
|
51
50
|
|
52
51
|
config/compass.rb
|
53
52
|
config/initializers/compass.rb
|
54
53
|
config/google.yml
|
55
|
-
config/nginx.conf
|
56
|
-
config/mime.types
|
57
54
|
|
58
55
|
The Scss files above will automatically get compiled to your Sass compilation directory:
|
59
56
|
|
@@ -65,7 +62,7 @@ manually add the following line to the top:
|
|
65
62
|
|
66
63
|
require 'html5-boilerplate'
|
67
64
|
|
68
|
-
### A few more minor points
|
65
|
+
### A few more minor points...
|
69
66
|
|
70
67
|
If you still have an application.html.erb in your layouts, you will need to loose
|
71
68
|
it now so that Rails will use your shiny new application.html.haml layout instead.
|
@@ -95,6 +92,7 @@ If you omit them, be sure to edit your javascript and style tags accordingly in
|
|
95
92
|
404.html
|
96
93
|
crossdomain.xml
|
97
94
|
robots.txt
|
95
|
+
humans.txt
|
98
96
|
apple-touch-icon.png
|
99
97
|
favicon.ico
|
100
98
|
|
@@ -103,21 +101,16 @@ If you omit them, be sure to edit your javascript and style tags accordingly in
|
|
103
101
|
src/partials/_base.scss
|
104
102
|
src/partials/_example.scss
|
105
103
|
src/partials/_page.scss
|
104
|
+
src/partials/_fonts.scss
|
105
|
+
src/partials/_media.scss
|
106
106
|
|
107
107
|
js/dd_belatedpng.js
|
108
|
-
js/jquery
|
109
|
-
js/modernizr
|
108
|
+
js/jquery.min.js
|
109
|
+
js/modernizr.min.js
|
110
110
|
js/plugins.js
|
111
|
-
js/profiling/charts.swf
|
112
|
-
js/profiling/config.js
|
113
|
-
js/profiling/yahoo-profiling.css
|
114
|
-
js/profiling/yahoo-profiling.min.js
|
115
111
|
|
116
112
|
.htaccess
|
117
113
|
config.rb
|
118
|
-
nginx.conf
|
119
|
-
mime.types
|
120
|
-
web.config
|
121
114
|
|
122
115
|
Run `compass watch my_project` and the SCSS files above will automatically
|
123
116
|
get compiled to your Sass compilation directory whenever a change is made:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -3,13 +3,7 @@ $base-font-size: 13px !default;
|
|
3
3
|
$base-line-height: 1.231 !default;
|
4
4
|
|
5
5
|
//
|
6
|
-
//
|
7
|
-
//
|
8
|
-
// There are three custom edits:
|
9
|
-
// * remove arial, helvetica from explicit font stack
|
10
|
-
// * we normalize monospace styles ourselves
|
11
|
-
// * table font-size is reset in the HTML5 reset above so there is no need to repeat
|
12
|
-
//
|
6
|
+
// Font normalization inspired by from the YUI Library's fonts.css: developer.yahoo.com/yui
|
13
7
|
// Whatever parts of this port of YUI to Sass that are copyrightable, are Copyright (c) 2008, Christopher Eppstein. All Rights Reserved.
|
14
8
|
//
|
15
9
|
|
@@ -41,12 +41,10 @@
|
|
41
41
|
visibility: hidden;
|
42
42
|
}
|
43
43
|
|
44
|
-
// Hide only visually, but have it available for screenreaders
|
44
|
+
// Hide only visually, but have it available for screenreaders: by Jon Neal
|
45
45
|
// www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden
|
46
46
|
@mixin visually-hidden {
|
47
|
-
position: absolute
|
48
|
-
clip: rect(1px 1px 1px 1px); // IE6, IE7
|
49
|
-
clip: rect(1px, 1px, 1px, 1px);
|
47
|
+
border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;
|
50
48
|
}
|
51
49
|
|
52
50
|
// Hide visually and from screenreaders, but maintain layout
|
@@ -21,13 +21,14 @@
|
|
21
21
|
// inlined to avoid required HTTP connection www.phpied.com/delay-loading-your-print-css/
|
22
22
|
|
23
23
|
@mixin media-print {
|
24
|
-
* { background: transparent !important; color: black !important; text-shadow: none !important;
|
24
|
+
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
|
25
|
+
-ms-filter: none !important; } // black prints faster: sanbeiji.com/archives/953
|
25
26
|
a, a:visited { color: #444 !important; text-decoration: underline; }
|
26
27
|
a[href]:after { content: " (" attr(href) ")"; }
|
27
28
|
abbr[title]:after { content: " (" attr(title) ")"; }
|
28
|
-
.ir a:after { content: ""; }
|
29
|
+
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } // don't show links for images, or javascript/internal links
|
29
30
|
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
30
|
-
thead { display: table-header-group; }
|
31
|
+
thead { display: table-header-group; } // css-discuss.incutio.com/wiki/Printing_Tables
|
31
32
|
tr, img { page-break-inside: avoid; }
|
32
33
|
@page { margin: 0.5cm; }
|
33
34
|
p, h2, h3 { orphans: 3; widows: 3; }
|
@@ -36,8 +37,8 @@
|
|
36
37
|
|
37
38
|
|
38
39
|
//
|
39
|
-
//
|
40
|
-
//
|
40
|
+
// media queries for responsive design
|
41
|
+
// these follow after primary styles so they will successfully override.
|
41
42
|
//
|
42
43
|
|
43
44
|
@mixin media-orientation-portrait {
|
@@ -48,8 +49,8 @@
|
|
48
49
|
// Style adjustments for landscape mode goes here
|
49
50
|
}
|
50
51
|
|
51
|
-
// Grade-A Mobile Browsers (Opera Mobile,
|
52
|
-
//
|
52
|
+
// Grade-A Mobile Browsers (Opera Mobile, Mobile Safari, Android Chrome)
|
53
|
+
// consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold
|
53
54
|
@mixin media-mobile($optimize: true) {
|
54
55
|
// j.mp/textsizeadjust
|
55
56
|
@if not $optimize {
|
@@ -15,39 +15,31 @@
|
|
15
15
|
@mixin html5-boilerplate-reset {
|
16
16
|
html, body, div, span, object, iframe,
|
17
17
|
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
18
|
-
abbr, address, cite, code,
|
19
|
-
|
20
|
-
small, strong, sub, sup, var,
|
21
|
-
b, i,
|
22
|
-
dl, dt, dd, ol, ul, li,
|
18
|
+
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
|
19
|
+
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
|
23
20
|
fieldset, form, label, legend,
|
24
21
|
table, caption, tbody, tfoot, thead, tr, th, td,
|
25
|
-
article, aside, canvas, details, figcaption, figure,
|
22
|
+
article, aside, canvas, details, figcaption, figure,
|
26
23
|
footer, header, hgroup, menu, nav, section, summary,
|
27
24
|
time, mark, audio, video {
|
28
25
|
margin:0;
|
29
26
|
padding:0;
|
30
27
|
border:0;
|
31
|
-
outline:0;
|
32
28
|
font-size:100%;
|
29
|
+
font: inherit;
|
33
30
|
vertical-align:baseline;
|
34
|
-
|
35
|
-
}
|
31
|
+
}
|
36
32
|
|
37
33
|
article, aside, details, figcaption, figure,
|
38
34
|
footer, header, hgroup, menu, nav, section {
|
39
|
-
|
35
|
+
display: block;
|
40
36
|
}
|
41
37
|
|
42
|
-
|
43
|
-
|
44
|
-
blockquote, q { quotes:none; }
|
38
|
+
blockquote, q { quotes: none; }
|
45
39
|
|
46
40
|
blockquote:before, blockquote:after,
|
47
41
|
q:before, q:after { content:''; content:none; }
|
48
42
|
|
49
|
-
a { margin:0; padding:0; border:0; font-size:100%; vertical-align:baseline; background:transparent; }
|
50
|
-
|
51
43
|
ins { background-color: #ff9; color: #000; text-decoration:none; }
|
52
44
|
|
53
45
|
mark { background-color: #ff9; color: #000; font-style:italic; font-weight:bold; }
|
@@ -56,8 +48,6 @@
|
|
56
48
|
|
57
49
|
abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; }
|
58
50
|
|
59
|
-
//
|
60
|
-
// tables still need cellspacing="0" in the markup
|
61
51
|
table { border-collapse:collapse; border-spacing:0; }
|
62
52
|
|
63
53
|
hr { display: block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
|
@@ -28,7 +28,7 @@ $list-left-margin: 1.8em !default;
|
|
28
28
|
|
29
29
|
sup { @include sup; }
|
30
30
|
|
31
|
-
textarea { overflow: auto; } //
|
31
|
+
textarea { overflow: auto; } // www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars
|
32
32
|
|
33
33
|
@include accessible-focus;
|
34
34
|
|
@@ -49,27 +49,24 @@ $list-left-margin: 1.8em !default;
|
|
49
49
|
@include no-nav-margins;
|
50
50
|
}
|
51
51
|
|
52
|
+
// set sub, sup without affecting line-height: gist.github.com/413930
|
52
53
|
@mixin sub{
|
53
|
-
|
54
|
+
font-size: 75%; line-height: 0; position: relative; bottom: -0.25em;
|
54
55
|
}
|
55
|
-
|
56
56
|
@mixin sup{
|
57
|
-
|
57
|
+
font-size: 75%; line-height: 0; position: relative; top: -0.5em;
|
58
58
|
}
|
59
59
|
|
60
|
-
//
|
60
|
+
// accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test
|
61
61
|
@mixin accessible-focus {
|
62
62
|
a:hover, a:active { outline: none; }
|
63
63
|
}
|
64
64
|
|
65
|
-
// www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap
|
65
|
+
// www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap
|
66
66
|
@mixin quoted-pre {
|
67
67
|
pre {
|
68
|
+
white-space: pre; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word;
|
68
69
|
padding: 15px;
|
69
|
-
white-space: pre; // CSS2
|
70
|
-
white-space: pre-wrap; // CSS 2.1
|
71
|
-
white-space: pre-line; // CSS 3 (and 2.1 as well, actually)
|
72
|
-
word-wrap: break-word; // IE
|
73
70
|
}
|
74
71
|
}
|
75
72
|
|
@@ -123,6 +120,6 @@ $list-left-margin: 1.8em !default;
|
|
123
120
|
}
|
124
121
|
|
125
122
|
@mixin no-nav-margins {
|
126
|
-
//
|
127
|
-
nav ul, nav li { margin: 0; }
|
123
|
+
// remove margins for navigation lists
|
124
|
+
nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
|
128
125
|
}
|
@@ -1,19 +1,14 @@
|
|
1
1
|
%head
|
2
2
|
%meta{ :charset => "utf-8" }/
|
3
3
|
|
4
|
-
-#
|
4
|
+
-#
|
5
5
|
Always force latest IE rendering engine (even in intranet) & Chrome Frame
|
6
6
|
Remove this if you use the .htaccess
|
7
7
|
%meta{ :content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible" }/
|
8
8
|
|
9
|
-
-# encoding must be specified within the first 512 bytes www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset
|
10
|
-
|
11
|
-
-# meta element for compatibility mode needs to be before all elements except title & meta msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx
|
12
|
-
-# Chrome Frame is only invoked if meta element for compatibility mode is within the first 1K bytes code.google.com/p/chromium/issues/detail?id=23003
|
13
|
-
|
14
9
|
%title
|
15
10
|
== #{ controller.controller_name.titleize } - #{ controller.action_name.titleize }
|
16
|
-
|
11
|
+
|
17
12
|
%meta{ :content => "", :name => "description" }/
|
18
13
|
%meta{ :content => "", :name => "author" }/
|
19
14
|
|
@@ -27,6 +22,6 @@
|
|
27
22
|
= render :partial => 'layouts/stylesheets'
|
28
23
|
|
29
24
|
-# All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects
|
30
|
-
= javascript_include_tag 'modernizr
|
25
|
+
= javascript_include_tag 'modernizr.min'
|
31
26
|
|
32
27
|
= csrf_meta_tag
|
@@ -9,30 +9,27 @@
|
|
9
9
|
|
10
10
|
-# fall back to local jQuery if necessary
|
11
11
|
:javascript
|
12
|
-
!window.jQuery && document.write(unescape('%3Cscript src="/javascripts/jquery
|
12
|
+
!window.jQuery && document.write(unescape('%3Cscript src="/javascripts/jquery.min.js"%3E%3C/script%3E'))
|
13
13
|
|
14
14
|
= javascript_include_tag 'rails', 'plugins', 'application'
|
15
15
|
|
16
|
+
-# Fix any <img> or .png_bg bg-images. Also, please read goo.gl/mZiyb
|
16
17
|
/[if lt IE 7 ]
|
17
18
|
:javascript
|
18
|
-
|
19
|
+
//DD_belatedPNG.fix('img, .png_bg');
|
19
20
|
|
20
21
|
-# Append your own using content_for :javascripts
|
21
22
|
= yield :javascripts
|
22
23
|
|
23
|
-
-# yui profiler and profileviewer
|
24
|
-
- if Rails.env == 'development'
|
25
|
-
= javascript_include_tag 'profiling/yahoo-profiling.min', 'profiling/config'
|
26
|
-
|
27
24
|
-# asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
|
28
25
|
-# Looks for google_account_id first in ENV['GOOGLE_ACCOUNT_ID'] then in config/google.yml
|
29
26
|
- if !google_account_id.blank?
|
30
27
|
:javascript
|
31
28
|
var _gaq = [['_setAccount', '#{google_account_id}'], ['_trackPageview']];
|
32
29
|
(function(d, t) {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
var g = d.createElement(t),
|
31
|
+
s = d.getElementsByTagName(t)[0];
|
32
|
+
g.async = true;
|
33
|
+
g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
34
|
+
s.parentNode.insertBefore(g, s);
|
38
35
|
})(document, 'script');
|
@@ -1,12 +1,12 @@
|
|
1
1
|
!!! 5
|
2
2
|
-# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
|
3
|
-
-ie_html :
|
3
|
+
-ie_html :class => 'no-js' do
|
4
4
|
= render :partial => 'layouts/head'
|
5
|
-
%body{ :class => "#{controller.controller_name}" }
|
5
|
+
%body{ :lang => 'en', :class => "#{controller.controller_name}" }
|
6
6
|
#container
|
7
7
|
%header#header
|
8
8
|
= render :partial => 'layouts/header'
|
9
|
-
#main
|
9
|
+
#main{ :role => 'main' }
|
10
10
|
= render :partial => 'layouts/flashes'
|
11
11
|
= yield
|
12
12
|
%footer#footer
|
@@ -7,11 +7,24 @@
|
|
7
7
|
# Techniques in here adapted from all over, including:
|
8
8
|
# Kroc Camen: camendesign.com/.htaccess
|
9
9
|
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
|
10
|
+
# Sample .htaccess file of CMS MODx: modxcms.com
|
10
11
|
|
11
12
|
|
13
|
+
###
|
14
|
+
### If you run a webserver other than apache, consider:
|
15
|
+
### github.com/paulirish/html5-boilerplate-server-configs
|
16
|
+
###
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
# ----------------------------------------------------------------------
|
21
|
+
# Better website experience for IE users
|
22
|
+
# ----------------------------------------------------------------------
|
23
|
+
|
12
24
|
# Force the latest IE version, in various cases when it may fall back to IE7 mode
|
13
25
|
# github.com/rails/rails/commit/123eb25#commitcomment-118920
|
14
26
|
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
|
27
|
+
|
15
28
|
<IfModule mod_setenvif.c>
|
16
29
|
<IfModule mod_headers.c>
|
17
30
|
BrowserMatch MSIE ie
|
@@ -26,15 +39,24 @@
|
|
26
39
|
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
|
27
40
|
</IfModule>
|
28
41
|
|
42
|
+
|
43
|
+
# ----------------------------------------------------------------------
|
44
|
+
# Cross-domain AJAX requests
|
45
|
+
# ----------------------------------------------------------------------
|
46
|
+
|
29
47
|
# Serve cross-domain ajax requests, disabled.
|
30
48
|
# enable-cors.org
|
31
49
|
# code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
|
50
|
+
|
32
51
|
# <IfModule mod_headers.c>
|
33
52
|
# Header set Access-Control-Allow-Origin "*"
|
34
53
|
# </IfModule>
|
35
54
|
|
36
55
|
|
37
56
|
|
57
|
+
# ----------------------------------------------------------------------
|
58
|
+
# Webfont access
|
59
|
+
# ----------------------------------------------------------------------
|
38
60
|
|
39
61
|
# allow access from all domains for webfonts
|
40
62
|
# alternatively you could only whitelist
|
@@ -47,6 +69,11 @@
|
|
47
69
|
</FilesMatch>
|
48
70
|
|
49
71
|
|
72
|
+
|
73
|
+
# ----------------------------------------------------------------------
|
74
|
+
# Proper MIME type for all files
|
75
|
+
# ----------------------------------------------------------------------
|
76
|
+
|
50
77
|
# audio
|
51
78
|
AddType audio/ogg oga ogg
|
52
79
|
|
@@ -64,10 +91,11 @@ AddEncoding gzip svgz
|
|
64
91
|
AddType application/vnd.ms-fontobject eot
|
65
92
|
AddType font/truetype ttf
|
66
93
|
AddType font/opentype otf
|
67
|
-
AddType font/woff
|
94
|
+
AddType font/opentype woff
|
95
|
+
# ^ hack to avoid chrome console warning: crbug.com/70283
|
68
96
|
|
69
97
|
# assorted types
|
70
|
-
AddType image/
|
98
|
+
AddType image/x-icon ico
|
71
99
|
AddType image/webp webp
|
72
100
|
AddType text/cache-manifest manifest
|
73
101
|
AddType text/x-component htc
|
@@ -77,10 +105,12 @@ AddType application/octet-stream safariextz
|
|
77
105
|
|
78
106
|
|
79
107
|
|
80
|
-
#
|
108
|
+
# ----------------------------------------------------------------------
|
109
|
+
# Allow concatenation from within specific js and css files
|
110
|
+
# ----------------------------------------------------------------------
|
81
111
|
|
82
112
|
# e.g. Inside of script.combined.js you could have
|
83
|
-
# <!--#include file="jquery
|
113
|
+
# <!--#include file="jquery.js" -->
|
84
114
|
# <!--#include file="jquery.idletimer.js" -->
|
85
115
|
# and they would be included into this single file
|
86
116
|
|
@@ -96,11 +126,20 @@ AddType application/octet-stream safariextz
|
|
96
126
|
|
97
127
|
|
98
128
|
|
129
|
+
# ----------------------------------------------------------------------
|
130
|
+
# gzip compression
|
131
|
+
# ----------------------------------------------------------------------
|
99
132
|
|
100
|
-
|
101
|
-
# gzip compression.
|
102
133
|
<IfModule mod_deflate.c>
|
103
134
|
|
135
|
+
|
136
|
+
# force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
|
137
|
+
<IfModule mod_setenvif.c>
|
138
|
+
<IfModule mod_headers.c>
|
139
|
+
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
|
140
|
+
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
|
141
|
+
</IfModule>
|
142
|
+
</IfModule>
|
104
143
|
# html, txt, css, js, json, xml, htc:
|
105
144
|
<IfModule filter_module>
|
106
145
|
FilterDeclare COMPRESS
|
@@ -125,6 +164,10 @@ AddType application/octet-stream safariextz
|
|
125
164
|
|
126
165
|
|
127
166
|
|
167
|
+
# ----------------------------------------------------------------------
|
168
|
+
# Expires headers (for better cache control)
|
169
|
+
# ----------------------------------------------------------------------
|
170
|
+
|
128
171
|
# these are pretty far-future expires headers
|
129
172
|
# they assume you control versioning with cachebusting query params like
|
130
173
|
# <script src="application.js?20100608">
|
@@ -151,12 +194,11 @@ AddType application/octet-stream safariextz
|
|
151
194
|
ExpiresByType application/xml "access plus 0 seconds"
|
152
195
|
ExpiresByType application/json "access plus 0 seconds"
|
153
196
|
|
154
|
-
|
155
197
|
# rss feed
|
156
198
|
ExpiresByType application/rss+xml "access plus 1 hour"
|
157
199
|
|
158
200
|
# favicon (cannot be renamed)
|
159
|
-
ExpiresByType image/
|
201
|
+
ExpiresByType image/x-icon "access plus 1 week"
|
160
202
|
|
161
203
|
# media: images, video, audio
|
162
204
|
ExpiresByType image/gif "access plus 1 month"
|
@@ -176,15 +218,19 @@ AddType application/octet-stream safariextz
|
|
176
218
|
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
|
177
219
|
|
178
220
|
# css and javascript
|
179
|
-
ExpiresByType text/css "access plus
|
180
|
-
ExpiresByType application/javascript "access plus
|
181
|
-
ExpiresByType text/javascript "access plus
|
182
|
-
|
183
|
-
|
221
|
+
ExpiresByType text/css "access plus 2 months"
|
222
|
+
ExpiresByType application/javascript "access plus 2 months"
|
223
|
+
ExpiresByType text/javascript "access plus 2 months"
|
224
|
+
<IfModule mod_headers.c>
|
225
|
+
Header append Cache-Control "public"
|
226
|
+
</IfModule>
|
184
227
|
</IfModule>
|
185
228
|
|
186
229
|
|
187
230
|
|
231
|
+
# ----------------------------------------------------------------------
|
232
|
+
# ETag removal
|
233
|
+
# ----------------------------------------------------------------------
|
188
234
|
|
189
235
|
# Since we're sending far-future expires, we don't need ETags for
|
190
236
|
# static content.
|
@@ -193,6 +239,24 @@ FileETag None
|
|
193
239
|
|
194
240
|
|
195
241
|
|
242
|
+
# ----------------------------------------------------------------------
|
243
|
+
# Stop screen flicker in IE on CSS rollovers
|
244
|
+
# ----------------------------------------------------------------------
|
245
|
+
|
246
|
+
# The following directives stop screen flicker in IE on CSS rollovers - in
|
247
|
+
# combination with the "ExpiresByType" rules for images (see above). If
|
248
|
+
# needed, un-comment the following rules.
|
249
|
+
|
250
|
+
# BrowserMatch "MSIE" brokenvary=1
|
251
|
+
# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
|
252
|
+
# BrowserMatch "Opera" !brokenvary
|
253
|
+
# SetEnvIf brokenvary 1 force-no-vary
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
# ----------------------------------------------------------------------
|
258
|
+
# Cookie setting from iframes
|
259
|
+
# ----------------------------------------------------------------------
|
196
260
|
|
197
261
|
# Allow cookies to be set from iframes (for IE only)
|
198
262
|
# If needed, uncomment and specify a path or regex in the Location directive
|
@@ -204,37 +268,148 @@ FileETag None
|
|
204
268
|
# </IfModule>
|
205
269
|
|
206
270
|
|
207
|
-
|
208
|
-
#
|
271
|
+
|
272
|
+
# ----------------------------------------------------------------------
|
273
|
+
# Start rewrite engine
|
274
|
+
# ----------------------------------------------------------------------
|
275
|
+
|
276
|
+
# Turning on the rewrite engine is necessary for the following rules and features.
|
277
|
+
|
209
278
|
<IfModule mod_rewrite.c>
|
210
279
|
RewriteEngine On
|
280
|
+
</IfModule>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
# ----------------------------------------------------------------------
|
285
|
+
# Suppress or force the "www." at the beginning of URLs
|
286
|
+
# ----------------------------------------------------------------------
|
287
|
+
|
288
|
+
# The same content should never be available under two different URLs - especially not with and
|
289
|
+
# without "www." at the beginning, since this can cause SEO problems (duplicate content).
|
290
|
+
# That's why you should choose one of the alternatives and redirect the other one.
|
291
|
+
|
292
|
+
# By default option 1 (no "www.") is activated. Remember: Shorter URLs are sexier.
|
293
|
+
# no-www.org/faq.php?q=class_b
|
294
|
+
|
295
|
+
# If you rather want to use option 2, just comment out all option 1 lines
|
296
|
+
# and uncomment option 2.
|
297
|
+
# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
|
298
|
+
|
299
|
+
# ----------------------------------------------------------------------
|
300
|
+
|
301
|
+
# Option 1:
|
302
|
+
# Rewrite "www.domain.com -> domain.com"
|
303
|
+
|
304
|
+
<IfModule mod_rewrite.c>
|
211
305
|
RewriteCond %{HTTPS} !=on
|
212
306
|
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
213
307
|
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
|
214
308
|
</IfModule>
|
215
309
|
|
310
|
+
# ----------------------------------------------------------------------
|
311
|
+
|
312
|
+
# Option 2:
|
313
|
+
# To rewrite "domain.com -> www.domain.com" uncomment the following lines.
|
314
|
+
# Be aware that the following rule might not be a good idea if you
|
315
|
+
# use "real" subdomains for certain parts of your website.
|
316
|
+
|
317
|
+
# <IfModule mod_rewrite.c>
|
318
|
+
# RewriteCond %{HTTPS} !=on
|
319
|
+
# RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
|
320
|
+
# RewriteCond %{HTTP_HOST} (.+)$ [NC]
|
321
|
+
# RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
|
322
|
+
# </IfModule>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
# ----------------------------------------------------------------------
|
327
|
+
# Prevent SSL cert warnings
|
328
|
+
# ----------------------------------------------------------------------
|
329
|
+
|
330
|
+
# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
|
331
|
+
# https://www.domain.com when your cert only allows https://secure.domain.com
|
332
|
+
# Uncomment the following lines to use this feature.
|
333
|
+
|
334
|
+
# <IfModule mod_rewrite.c>
|
335
|
+
# RewriteCond %{SERVER_PORT} !^443
|
336
|
+
# RewriteRule (.*) https://example-domain-please-change.com.com/$1 [R=301,L]
|
337
|
+
# </IfModule>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
# ----------------------------------------------------------------------
|
342
|
+
# Prevent 404 errors for non-existing redirected folders
|
343
|
+
# ----------------------------------------------------------------------
|
344
|
+
|
216
345
|
# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
|
217
346
|
# e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
|
347
|
+
|
218
348
|
Options -MultiViews
|
219
|
-
# -Indexes will have Apache block users from browsing folders without a default document
|
220
|
-
# Options -Indexes
|
221
349
|
|
222
350
|
|
223
351
|
|
352
|
+
# ----------------------------------------------------------------------
|
224
353
|
# custom 404 page
|
354
|
+
# ----------------------------------------------------------------------
|
355
|
+
|
225
356
|
ErrorDocument 404 /404.html
|
226
357
|
|
227
358
|
|
228
359
|
|
360
|
+
# ----------------------------------------------------------------------
|
361
|
+
# UTF-8 encoding
|
362
|
+
# ----------------------------------------------------------------------
|
363
|
+
|
229
364
|
# use utf-8 encoding for anything served text/plain or text/html
|
230
365
|
AddDefaultCharset utf-8
|
366
|
+
|
231
367
|
# force utf-8 for a number of file formats
|
232
368
|
AddCharset utf-8 .html .css .js .xml .json .rss
|
233
369
|
|
234
370
|
|
235
371
|
|
236
|
-
#
|
237
|
-
|
372
|
+
# ----------------------------------------------------------------------
|
373
|
+
# A little more security
|
374
|
+
# ----------------------------------------------------------------------
|
375
|
+
|
376
|
+
|
377
|
+
# Do we want to advertise the exact version number of Apache we're running?
|
378
|
+
# Probably not.
|
379
|
+
## This can only be enabled if used in httpd.conf - It will not work in .htaccess
|
380
|
+
# ServerTokens Prod
|
381
|
+
|
382
|
+
|
383
|
+
# "-Indexes" will have Apache block users from browsing folders without a default document
|
384
|
+
# Usually you should leave this activated, because you shouldn't allow everybody to surf through
|
385
|
+
# every folder on your server (which includes rather private places like CMS system folders).
|
386
|
+
# Options -Indexes
|
387
|
+
|
388
|
+
|
389
|
+
# Block access to "hidden" directories whose names begin with a period. This
|
390
|
+
# includes directories used by version control systems such as Subversion or Git.
|
391
|
+
<IfModule mod_rewrite.c>
|
392
|
+
RewriteRule "(^|/)\." - [F]
|
393
|
+
</IfModule>
|
394
|
+
|
395
|
+
|
396
|
+
# If your server is not already configured as such, the following directive
|
397
|
+
# should be uncommented in order to set PHP's register_globals option to OFF.
|
398
|
+
# This closes a major security hole that is abused by most XSS (cross-site
|
399
|
+
# scripting) attacks. For more information: http://php.net/register_globals
|
400
|
+
#
|
401
|
+
# IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
|
402
|
+
#
|
403
|
+
# Your server does not allow PHP directives to be set via .htaccess. In that
|
404
|
+
# case you must make this change in your php.ini file instead. If you are
|
405
|
+
# using a commercial web host, contact the administrators for assistance in
|
406
|
+
# doing this. Not all servers allow local php.ini files, and they should
|
407
|
+
# include all PHP configurations (not just this one), or you will effectively
|
408
|
+
# reset everything to PHP defaults. Consult www.php.net for more detailed
|
409
|
+
# information about setting PHP directives.
|
410
|
+
|
411
|
+
# php_flag register_globals Off
|
412
|
+
|
238
413
|
|
239
414
|
|
240
415
|
|