承接 humanmade/mercator-redirect 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

humanmade/mercator-redirect

最新稳定版本:0.1.0

Composer 安装命令:

composer require humanmade/mercator-redirect

包简介

Redirect component for Mercator.

关键字:

README 文档

README

Redirect component for Mercator.

Redirects to the domain listed in the wp_blogs table. With newer versions of Mercator this should be treated as the primary domain.

The addon also supports redirecting to aliases for legacy data.

Requirements

Mercator requires WordPress 3.9 or newer for the new sunrise processes. Mercator also requires PHP 5.3+ due to the use of namespaced code.

Installation

Include the file redirect.php from your sunrise.php in the same way you include Mercator itself.

For example:

<?php
// Default mu-plugins directory if you haven't set it
defined( 'WPMU_PLUGIN_DIR' ) or define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' );

require WPMU_PLUGIN_DIR . '/mercator/mercator.php';
require WPMU_PLUGIN_DIR . '/mercator-redirect/redirect.php';

Filters

You can modify SSO behaviour for example in a local environment with the following filters in sunrise.php:

mercator.redirect.enabled

Defaults to true

// Disable redirects
add_filter( 'mercator.redirect.enabled', '__return_false' );

mercator.redirect.admin.enabled

Defaults to false

// Enable redirecting the admin
add_filter( 'mercator.redirect.admin.enabled', '__return_true' );

mercator.redirect.legacy.enabled

Defaults to false

// Enable legacy redirects
add_filter( 'mercator.redirect.legacy.enabled', '__return_true' );

mercator.redirect.status.code

Defaults to 301

// Change http redirect from 301 to 302.
add_filter( 'mercator.redirect.status.code', function() { return 302; } );

License

Mercator is licensed under the GPLv3 or later.

Credits

Created by Human Made for high volume and large-scale sites, such as Happytables. We run Mercator on sites with millions of monthly page views, and thousands of sites.

Written and maintained by Ryan McCue. Thanks to all our contributors.

Mercator builds on concepts from WPMU Domain Mapping, written by Donncha O'Caoimh, Ron Rennick, and contributors.

Mercator relies on WordPress core, building on core functionality added in WP27003. Thanks to all involved in the overhaul, including Andrew Nacin and Jeremy Felt.

Interested in joining in on the fun? Join us, and become human!

统计信息

  • 总下载量: 11.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 15
  • Watchers: 25
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2018-12-04