mirror of
https://github.com/h5bp/html5-boilerplate.git
synced 2026-01-08 22:28:10 -05:00
Remove apache-server-configs / .htaccess
This commit is contained in:
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -19,10 +19,3 @@
|
||||
*.sh text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.xml text eol=lf
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Exclude the `.htaccess` file from GitHub's language statistics
|
||||
# https://github.com/github/linguist#using-gitattributes
|
||||
|
||||
dist/.htaccess linguist-vendored
|
||||
|
||||
1
.github/ISSUE_TEMPLATE.md
vendored
1
.github/ISSUE_TEMPLATE.md
vendored
@@ -13,7 +13,6 @@
|
||||
respect the opinions of others.
|
||||
|
||||
* Please **do not** open issues or pull requests regarding the code in
|
||||
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
|
||||
[`Modernizr`](https://github.com/Modernizr/Modernizr) or
|
||||
[`Normalize.css`](https://github.com/necolas/normalize.css) (open them in
|
||||
their respective repositories).
|
||||
|
||||
1261
dist/.htaccess
vendored
1261
dist/.htaccess
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,13 @@
|
||||
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
|
||||
table of contents](TOC.md)
|
||||
|
||||
# Extend and customise HTML5 Boilerplate
|
||||
# Extend and customize HTML5 Boilerplate
|
||||
|
||||
Here is some useful advice for how you can make your project with HTML5
|
||||
Boilerplate even better. We don't want to include it all by default, as not
|
||||
everything fits with everyone's needs.
|
||||
|
||||
* [Server Configuration](#server-configuration)
|
||||
* [App Stores](#app-stores)
|
||||
* [DNS prefetching](#dns-prefetching)
|
||||
* [Internet Explorer](#internet-explorer)
|
||||
@@ -19,6 +20,18 @@ everything fits with everyone's needs.
|
||||
* [humans.txt](#humanstxt)
|
||||
* [security.txt](#security.txt)
|
||||
|
||||
|
||||
## Server Configuration
|
||||
|
||||
We no longer include a [`.htaccess`](#htaccess) file for the [Apache HTTP
|
||||
server](https://httpd.apache.org/docs/) in HTML5 Boilerplate by default, however if you are
|
||||
using a web server, then we encourage you to checkout out the [server configuration](https://github.com/h5bp/server-configs)
|
||||
that corresponds to your web server and environment.
|
||||
|
||||
These repos offer a collection of configuration snippets that can help your server improve the
|
||||
website's performance and security, while also ensuring that resources are served with the
|
||||
correct content-type and are accessible, if needed, even cross-domain.
|
||||
|
||||
## App Stores
|
||||
|
||||
### Smart App Banners in iOS 6+ Safari
|
||||
|
||||
53
docs/misc.md
53
docs/misc.md
@@ -57,59 +57,6 @@ access to `.editorconfig` files, as they can disclose sensitive information!
|
||||
For more details, please refer to the [EditorConfig
|
||||
project](https://editorconfig.org/).
|
||||
|
||||
## Server Configuration
|
||||
|
||||
H5BP includes a [`.htaccess`](#htaccess) file for the [Apache HTTP
|
||||
server](https://httpd.apache.org/docs/). If you are not using Apache
|
||||
as your web server, then you are encouraged to download a
|
||||
[server configuration](https://github.com/h5bp/server-configs) that
|
||||
corresponds to your web server and environment.
|
||||
|
||||
A `.htaccess` (hypertext access) file is an [Apache HTTP server
|
||||
configuration file](https://github.com/h5bp/server-configs-apache).
|
||||
The `.htaccess` file is mostly used for:
|
||||
|
||||
* Rewriting URLs
|
||||
* Controlling cache
|
||||
* Authentication
|
||||
* Server-side includes
|
||||
* Redirects
|
||||
* Gzipping
|
||||
|
||||
If you have access to the main server configuration file (usually called
|
||||
`httpd.conf`), you should add the logic from the `.htaccess` file in, for
|
||||
example, a `<Directory>` section in the main configuration file. This is usually
|
||||
the recommended way, as using .htaccess files slows down Apache!
|
||||
|
||||
To enable Apache modules locally, please see [the Apache modules documentation](https://github.com/h5bp/server-configs-apache#enable-apache-httpd-modules)
|
||||
|
||||
In the repo the `.htaccess` is used for:
|
||||
|
||||
* Allowing cross-origin access to web fonts
|
||||
* CORS header for images when browsers request it
|
||||
* Enable `404.html` as 404 error document
|
||||
* Making the website experience better for IE users better
|
||||
* Media UTF-8 as character encoding for `text/html` and `text/plain`
|
||||
* Enabling the rewrite URLs engine
|
||||
* Forcing or removing the `www.` at the begin of a URL
|
||||
* It blocks access to directories without a default document
|
||||
* It blocks access to files that can expose sensitive information.
|
||||
* It reduces MIME type security risks
|
||||
* It forces compressing (gzipping)
|
||||
* It tells the browser whether they should request a specific file from the
|
||||
server or whether they should grab it from the browser's cache
|
||||
|
||||
When using `.htaccess` we recommend reading all inline comments (the rules after
|
||||
a `#`) in the file once. There is a bunch of optional stuff in it.
|
||||
|
||||
If you want to know more about the `.htaccess` file check out the
|
||||
[Apache HTTP server docs](https://httpd.apache.org/docs/) or more
|
||||
specifically the [htaccess
|
||||
section](https://httpd.apache.org/docs/current/howto/htaccess.html).
|
||||
|
||||
Notice that the original repo for the `.htaccess` file is [this
|
||||
one](https://github.com/h5bp/server-configs-apache).
|
||||
|
||||
## robots.txt
|
||||
|
||||
The `robots.txt` file is used to give instructions to web robots on what can
|
||||
|
||||
@@ -39,7 +39,6 @@ A basic HTML5 Boilerplate site initially looks something like this:
|
||||
│ └── vendor
|
||||
│ └── modernizr.min.js
|
||||
├── .editorconfig
|
||||
├── .htaccess
|
||||
├── 404.html
|
||||
├── browserconfig.xml
|
||||
├── favicon.ico
|
||||
@@ -74,17 +73,6 @@ This directory should contain all your project's JS files. Libraries, plugins,
|
||||
and custom code can all be included here. It includes some initial JS to help
|
||||
get you started. [About the JavaScript](js.md).
|
||||
|
||||
### .htaccess
|
||||
|
||||
The default web server configs are for Apache. For more information, please
|
||||
refer to the [Apache Server Configs
|
||||
repository](https://github.com/h5bp/server-configs-apache).
|
||||
|
||||
Host your site on a server other than Apache? You're likely to find the
|
||||
corresponding server configs project listed in our [Server
|
||||
Configs](https://github.com/h5bp/server-configs/blob/master/README.md)
|
||||
repository.
|
||||
|
||||
### 404.html
|
||||
|
||||
A helpful custom 404 to get you started.
|
||||
|
||||
@@ -73,12 +73,6 @@ gulp.task('clean', (done) => {
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('copy:.htaccess', () =>
|
||||
gulp.src('node_modules/apache-server-configs/dist/.htaccess')
|
||||
.pipe(plugins().replace(/# ErrorDocument/g, 'ErrorDocument'))
|
||||
.pipe(gulp.dest(dirs.dist))
|
||||
);
|
||||
|
||||
gulp.task('copy:index.html', () => {
|
||||
|
||||
let modernizrVersion = pkg.devDependencies.modernizr;
|
||||
@@ -150,14 +144,13 @@ gulp.task('lint:js', () =>
|
||||
// | Main tasks |
|
||||
// ---------------------------------------------------------------------
|
||||
gulp.task(
|
||||
'copy',
|
||||
"copy",
|
||||
gulp.series(
|
||||
'copy:.htaccess',
|
||||
'copy:index.html',
|
||||
'copy:license',
|
||||
'copy:style',
|
||||
'copy:misc',
|
||||
'copy:normalize'
|
||||
"copy:index.html",
|
||||
"copy:license",
|
||||
"copy:style",
|
||||
"copy:misc",
|
||||
"copy:normalize"
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
13
package-lock.json
generated
13
package-lock.json
generated
@@ -12,7 +12,6 @@
|
||||
"@babel/core": "^7.18.2",
|
||||
"@babel/preset-env": "^7.18.2",
|
||||
"@babel/register": "^7.17.7",
|
||||
"apache-server-configs": "^5.0.0",
|
||||
"archiver": "^5.3.1",
|
||||
"del": "^6.1.1",
|
||||
"eslint": "^8.17.0",
|
||||
@@ -2068,12 +2067,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/apache-server-configs": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/apache-server-configs/-/apache-server-configs-5.0.0.tgz",
|
||||
"integrity": "sha512-98xsjhp1rIptxK7sGLzZcPdBNqCVXXicidl58WhWmY2KM/ijlH3DBmPmfxWo3tzweThNeOsWPuCYIL59NbOr7Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/append-buffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz",
|
||||
@@ -14759,12 +14752,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"apache-server-configs": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/apache-server-configs/-/apache-server-configs-5.0.0.tgz",
|
||||
"integrity": "sha512-98xsjhp1rIptxK7sGLzZcPdBNqCVXXicidl58WhWmY2KM/ijlH3DBmPmfxWo3tzweThNeOsWPuCYIL59NbOr7Q==",
|
||||
"dev": true
|
||||
},
|
||||
"append-buffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz",
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
"@babel/core": "^7.18.2",
|
||||
"@babel/preset-env": "^7.18.2",
|
||||
"@babel/register": "^7.17.7",
|
||||
"apache-server-configs": "^5.0.0",
|
||||
"archiver": "^5.3.1",
|
||||
"del": "^6.1.1",
|
||||
"eslint": "^8.17.0",
|
||||
|
||||
@@ -51,11 +51,6 @@ function runTests() {
|
||||
|
||||
describe(`Test if the files from the "${dir}" directory have the expected content`, () => {
|
||||
|
||||
it('".htaccess" should have the "ErrorDocument..." line uncommented', (done) => {
|
||||
const string = '\n\nErrorDocument 404 /404.html\n\n';
|
||||
checkString(path.resolve(dir, '.htaccess'), string, done);
|
||||
});
|
||||
|
||||
it('"index.html" should contain the correct Modernizr version in the local URL', (done) => {
|
||||
const string = `js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`;
|
||||
checkString(path.resolve(dir, 'index.html'), string, done);
|
||||
|
||||
@@ -16,7 +16,6 @@ const expectedFilesInDistDir = [
|
||||
'.editorconfig',
|
||||
'.gitattributes',
|
||||
'.gitignore',
|
||||
'.htaccess',
|
||||
'404.html',
|
||||
'package.json',
|
||||
'browserconfig.xml',
|
||||
|
||||
Reference in New Issue
Block a user