roots/wp-h5bp-htaccess
最新稳定版本:2.0.1
Composer 安装命令:
composer require roots/wp-h5bp-htaccess
包简介
HTML5 Boilerplate's .htaccess for WordPress
关键字:
README 文档
README
Add HTML5 Boilerplate's .htaccess to your WordPress installation.
Installation
You can install this plugin via the command-line or the WordPress admin panel.
via Command-line
If you're using Composer to manage 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.
wp plugin activate wp-h5bp-htaccess
via WordPress Admin Panel
- Download the latest zip of this repo.
- In your WordPress admin panel, navigate to Plugins->Add New
- Click Upload Plugin
- Upload the zip file that you downloaded.
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 !!!
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)
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
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
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
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
2.0.1: April 29th, 2015
2.0.0: 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
- Update to Apache Server Configs v2.4.1
1.0.0: April 30th, 2013
- Removed from Roots Theme, moved to plugin
License
- Apache Server Configs: MIT License
- Everything else: MIT License
roots/wp-h5bp-htaccess 适用场景与选型建议
roots/wp-h5bp-htaccess 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21.58k 次下载、GitHub Stars 达 156, 最近一次更新时间为 2014 年 06 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 roots/wp-h5bp-htaccess 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roots/wp-h5bp-htaccess 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 roots/wp-h5bp-htaccess 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
Inertia.js server-side adapter for PHP. Handles full visits, Inertia XHR visits, asset-version 409 handshakes and partial reloads. Framework-agnostic, with transparent WordPress integration.
Adds Cache-Tag HTTP response headers for singular WordPress content and purges Cloudflare by tag when content changes.
AI Chatbot & Helpdesk Agent for WooCommerce. Connects your store to Egentify for AI-powered chat, order tracking, email, and ticketing.
MIDDAG's reference architecture for a WordPress plugin — composes the OSS framework/wordpress/ui libraries end to end.
Assets helper package for the Hybrid Core framework.
统计信息
- 总下载量: 21.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 157
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-06-07