PHPackages                             roots/wp-h5bp-htaccess - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. roots/wp-h5bp-htaccess

AbandonedArchivedWordpress-plugin[Utility &amp; Helpers](/categories/utility)

roots/wp-h5bp-htaccess
======================

HTML5 Boilerplate's .htaccess for WordPress

2.0.1(11y ago)15721.6k↓50%34[1 issues](https://github.com/roots/wp-h5bp-htaccess/issues)[2 PRs](https://github.com/roots/wp-h5bp-htaccess/pulls)MITPHPPHP &gt;=5.4.0

Since Jun 7Pushed 5y ago24 watchersCompare

[ Source](https://github.com/roots/wp-h5bp-htaccess)[ Packagist](https://packagist.org/packages/roots/wp-h5bp-htaccess)[ Docs](http://roots.io/plugins/html5-boilerplate-htaccess/)[ RSS](/packages/roots-wp-h5bp-htaccess/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

HTML5 Boilerplate's `.htaccess` for WordPress
=============================================

[](#html5-boilerplates-htaccess-for-wordpress)

[![Build Status](https://camo.githubusercontent.com/aca8269635dcd7faff5b4fb7e5d296c88532b769b326cf947330905fdeb46a0d/68747470733a2f2f7472617669732d63692e6f72672f726f6f74732f77702d683562702d68746163636573732e737667)](https://travis-ci.org/roots/wp-h5bp-htaccess)

Add [HTML5 Boilerplate's `.htaccess`](https://github.com/h5bp/server-configs-apache) to your WordPress installation.

Installation
------------

[](#installation)

You can install this plugin via the command-line or the WordPress admin panel.

### via Command-line

[](#via-command-line)

If you're [using Composer to manage WordPress](https://roots.io/using-composer-with-wordpress/), add wp-h5bp-htaccess to your project's dependencies.

```
composer require roots/wp-h5bp-htaccess 2.0.1
```

Then activate the plugin via [wp-cli](http://wp-cli.org/commands/plugin/activate/).

```
wp plugin activate wp-h5bp-htaccess
```

### via WordPress Admin Panel

[](#via-wordpress-admin-panel)

1. Download the [latest zip](https://github.com/roots/wp-h5bp-htaccess/archive/master.zip) of this repo.
2. In your WordPress admin panel, navigate to Plugins-&gt;Add New
3. Click Upload Plugin
4. Upload the zip file that you downloaded.

Configuration
-------------

[](#configuration)

The plugin will work right out of the box, but we have made some options available to developers who wish to fine-tune the resulting `.htaccess` file.

### !!! WARNING !!!

[](#-warning-)

Using these configuration options can result in unexpected, undesired, and even damaging behaviors. You must understand that changing the output of this plugin will change what WordPress puts into your `.htaccess` file. Misconfigured `.htaccess` files will likely result server errors. Be sure that you have a way of removing the `.htaccess` file if necessary.

### Use a custom server config (`server_configs.conf`)

[](#use-a-custom-server-config-server_configsconf)

You can use your own server config instead of the included Apache Server Config by H5BP. Do this by placing a file named `server_configs.conf` in the root of your theme directory.

```
/
├── wp-admin/
├── wp-content/
│   └── themes/
│       └── your-theme-here/
│           └── server_configs.conf
└── wp-includes/

```

### Hooks

[](#hooks)

There are a few WordPress filters into which a developer can hook to modify the resulting `.htaccess` file. The rules below are listed in the order in which they are applied in the code.

#### `roots/h5bp-htaccess-filters`

[](#rootsh5bp-htaccess-filters)

This hook passes an associative array of modification filters to be applied to the rules where the keys of the array represent a string that is to be searched and the values of the array represent a replacement.

Use this for simple string replacements, such as commenting out lines.

```
add_filter('roots/h5bp-htaccess-filters', function($rules_filters) {
  // comments out all `RewriteRule`s
  $rules_filters['RewriteRule'] = '# RewriteRule';
  return $rules_filters;
});
```

#### `roots/h5bp-htaccess-rules`

[](#rootsh5bp-htaccess-rules)

This hook passes a string containing all of the rules that are going to be added to your `.htaccess` file by this plugin.

```
add_filter('roots/h5bp-htaccess-rules', function($server_config_rules) {
  // Removes all comments and whitespace
  return preg_replace(['/#.*/', '/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/'], ['',PHP_EOL], $server_config_rules);
});
```

Changelog
---------

[](#changelog)

### 2.0.1: April 29th, 2015

[](#201-april-29th-2015)

- Fix reference error ([\#12](https://github.com/roots/wp-h5bp-htaccess/issues/12))
- Update link to h5bp server config repo ([\#13](https://github.com/roots/wp-h5bp-htaccess/issues/13))

### 2.0.0: April 11th, 2015

[](#200-april-11th-2015)

- Update to Apache Server Configs v2.14.0
- Rewrote plugin as a class
- Rewrote logic so that server and WordPress configurations are only checked when plugin is actively in use
- Added filters to provide users with more control over the rules that are being applied
- Added a dedicated WordPress section to the bottom of h5bp-htaccess

### 1.1.0: June 7th, 2014

[](#110-june-7th-2014)

- Update to Apache Server Configs v2.4.1

### 1.0.0: April 30th, 2013

[](#100-april-30th-2013)

- Removed from [Roots Theme](http://www.rootstheme.com/), moved to plugin

License
-------

[](#license)

- [Apache Server Configs](https://github.com/h5bp/server-configs-apache): MIT License
- Everything else: MIT License

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~162 days

Total

3

Last Release

4038d ago

Major Versions

1.1.0 → 2.0.02015-04-12

PHP version history (2 changes)1.1.0PHP &gt;=5.3.0

2.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3f71fa88954b93f55af5e121f1d8c38d240a0d17712c092a389bcccffa34415?d=identicon)[retlehs](/maintainers/retlehs)

![](https://avatars.githubusercontent.com/u/2104321?v=4)[QWp6t](/maintainers/QWp6t)[@QWp6t](https://github.com/QWp6t)

---

Top Contributors

[![retlehs](https://avatars.githubusercontent.com/u/115911?v=4)](https://github.com/retlehs "retlehs (11 commits)")[![QWp6t](https://avatars.githubusercontent.com/u/2104321?v=4)](https://github.com/QWp6t "QWp6t (8 commits)")[![bostondv](https://avatars.githubusercontent.com/u/133814?v=4)](https://github.com/bostondv "bostondv (2 commits)")[![mike-source](https://avatars.githubusercontent.com/u/6898265?v=4)](https://github.com/mike-source "mike-source (1 commits)")[![alrra](https://avatars.githubusercontent.com/u/1223565?v=4)](https://github.com/alrra "alrra (1 commits)")[![robsimpkins](https://avatars.githubusercontent.com/u/5339220?v=4)](https://github.com/robsimpkins "robsimpkins (1 commits)")[![swalkinshaw](https://avatars.githubusercontent.com/u/295605?v=4)](https://github.com/swalkinshaw "swalkinshaw (1 commits)")

---

Tags

wordpress

### Embed Badge

![Health badge](/badges/roots-wp-h5bp-htaccess/health.svg)

```
[![Health](https://phpackages.com/badges/roots-wp-h5bp-htaccess/health.svg)](https://phpackages.com/packages/roots-wp-h5bp-htaccess)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[cedaro/gravity-forms-iframe

Embed a Gravity Form on any site using an iframe.

1563.0k](/packages/cedaro-gravity-forms-iframe)[iceicetimmy/acf-post-type-selector

Post type selector for Advanced Custom Fields.

559.0k](/packages/iceicetimmy-acf-post-type-selector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
