{"id":29150188,"url":"https://github.com/humanmade/mercator-redirect","last_synced_at":"2025-06-30T23:09:47.409Z","repository":{"id":56987052,"uuid":"68720875","full_name":"humanmade/Mercator-Redirect","owner":"humanmade","description":"Redirect handler for mapped domains","archived":false,"fork":false,"pushed_at":"2020-05-08T15:13:21.000Z","size":24,"stargazers_count":15,"open_issues_count":4,"forks_count":11,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-06-30T16:14:53.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humanmade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-20T14:35:14.000Z","updated_at":"2020-05-08T03:48:46.000Z","dependencies_parsed_at":"2022-08-21T13:20:16.789Z","dependency_job_id":null,"html_url":"https://github.com/humanmade/Mercator-Redirect","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/humanmade/Mercator-Redirect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FMercator-Redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FMercator-Redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FMercator-Redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FMercator-Redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humanmade","download_url":"https://codeload.github.com/humanmade/Mercator-Redirect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FMercator-Redirect/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262864258,"owners_count":23376461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-30T23:09:45.919Z","updated_at":"2025-06-30T23:09:47.380Z","avatar_url":"https://github.com/humanmade.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mercator Redirect\nRedirect component for [Mercator](https://github.com/humanmade/Mercator).\n\nRedirects to the domain listed in the `wp_blogs` table. With newer versions\nof Mercator this should be treated as the primary domain.\n\nThe addon also supports redirecting to aliases for legacy data.\n\n## Requirements\nMercator requires WordPress 3.9 or newer for the new sunrise processes. Mercator\nalso requires PHP 5.3+ due to the use of namespaced code.\n\n## Installation\nInclude the file `redirect.php` from your `sunrise.php` in the same way you include Mercator itself.\n\nFor example:\n\n```php\n\u003c?php\n// Default mu-plugins directory if you haven't set it\ndefined( 'WPMU_PLUGIN_DIR' ) or define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' );\n\nrequire WPMU_PLUGIN_DIR . '/mercator/mercator.php';\nrequire WPMU_PLUGIN_DIR . '/mercator-redirect/redirect.php';\n```\n\n## Filters\nYou can modify SSO behaviour for example in a local environment with the\nfollowing filters in `sunrise.php`:\n\n**mercator.redirect.enabled**\n\nDefaults to `true`\n\n```php\n// Disable redirects\nadd_filter( 'mercator.redirect.enabled', '__return_false' );\n```\n\n**mercator.redirect.admin.enabled**\n\nDefaults to `false`\n\n```php\n// Enable redirecting the admin\nadd_filter( 'mercator.redirect.admin.enabled', '__return_true' );\n```\n\n**mercator.redirect.legacy.enabled**\n\nDefaults to `false`\n\n```php\n// Enable legacy redirects\nadd_filter( 'mercator.redirect.legacy.enabled', '__return_true' );\n```\n\n**mercator.redirect.status.code**\n\nDefaults to 301\n\n```php\n// Change http redirect from 301 to 302.\nadd_filter( 'mercator.redirect.status.code', function() { return 302; } );\n```\n\n## License\nMercator is licensed under the GPLv3 or later.\n\n## Credits\nCreated by Human Made for high volume and large-scale sites, such as [Happytables](http://happytables.com/). We run Mercator on sites with millions of monthly page views, and thousands of sites.\n\nWritten and maintained by [Ryan McCue](https://github.com/rmccue). Thanks to all our [contributors](https://github.com/humanmade/Mercator-SSO/graphs/contributors).\n\nMercator builds on concepts from [WPMU Domain Mapping][], written by Donncha O'Caoimh, Ron Rennick, and contributors.\n\nMercator relies on WordPress core, building on core functionality added in [WP27003][]. Thanks to all involved in the overhaul, including Andrew Nacin and Jeremy Felt.\n\n[WPMU Domain Mapping]: http://wordpress.org/plugins/wordpress-mu-domain-mapping/\n[WP27003]: https://core.trac.wordpress.org/ticket/27003\n\nInterested in joining in on the fun? [Join us, and become human!](https://hmn.md/is/hiring/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fmercator-redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumanmade%2Fmercator-redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fmercator-redirect/lists"}