{"id":106617,"date":"2019-07-16T14:24:20","date_gmt":"2019-07-16T14:24:20","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/multisite-blog-alias\/"},"modified":"2025-12-05T13:41:39","modified_gmt":"2025-12-05T13:41:39","slug":"multisite-blog-alias","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/multisite-blog-alias\/","author":9668177,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.1","stable_tag":"1.2.1","tested":"6.9.4","requires":"4.8","requires_php":"7.4","requires_plugins":null,"header_name":"Multisite Blog Alias","header_author":"J\u00f6rn Lund","header_description":"Alias Domains for Blogs","assets_banners_color":"e46000","last_updated":"2025-12-05 13:41:39","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/donate.unhcr.org\/","header_plugin_uri":"https:\/\/github.com\/mcguffin\/multisite-blog-alias","header_author_uri":"https:\/\/github.com\/mcguffin","rating":5,"author_block_rating":0,"active_installs":0,"downloads":7855,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"podpirate","date":"2019-07-17 06:10:38"},"1.0.1":{"tag":"1.0.1","author":"podpirate","date":"2019-10-15 12:11:48"},"1.0.2":{"tag":"1.0.2","author":"podpirate","date":"2019-11-19 11:23:24"},"1.0.3":{"tag":"1.0.3","author":"podpirate","date":"2020-01-22 14:00:13"},"1.0.4":{"tag":"1.0.4","author":"podpirate","date":"2020-01-24 16:08:25"},"1.1.0":{"tag":"1.1.0","author":"podpirate","date":"2020-02-25 14:11:20"},"1.1.1":{"tag":"1.1.1","author":"podpirate","date":"2020-05-09 09:36:25"},"1.1.2":{"tag":"1.1.2","author":"podpirate","date":"2020-07-05 12:00:33"},"1.1.3":{"tag":"1.1.3","author":"podpirate","date":"2020-07-06 10:55:07"},"1.1.4":{"tag":"1.1.4","author":"podpirate","date":"2020-12-20 18:38:24"},"1.1.5":{"tag":"1.1.5","author":"podpirate","date":"2021-02-03 12:25:20"},"1.1.6":{"tag":"1.1.6","author":"podpirate","date":"2021-02-25 12:48:44"},"1.1.7":{"tag":"1.1.7","author":"podpirate","date":"2022-09-14 12:55:01"},"1.1.8":{"tag":"1.1.8","author":"podpirate","date":"2022-09-23 11:35:25"},"1.1.9":{"tag":"1.1.9","author":"podpirate","date":"2023-05-03 12:32:54"},"1.2.0":{"tag":"1.2.0","author":"podpirate","date":"2024-03-06 15:21:49"},"1.2.1":{"tag":"1.2.1","author":"podpirate","date":"2025-12-05 13:41:39"}},"upgrade_notice":{"":"<p>On the whole upgrading is always a good idea.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":5},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2124013,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2124013,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2124013,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2124013,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8","1.1.9","1.2.0","1.2.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3046426,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"Network admin - Edit site. I completely messed up a few webservers to run the last test in the list!"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[555,441,325,727],"plugin_category":[51],"plugin_contributors":[78906],"plugin_business_model":[],"class_list":["post-106617","plugin","type-plugin","status-publish","hentry","plugin_tags-domain","plugin_tags-multisite","plugin_tags-network","plugin_tags-redirect","plugin_category-multisite","plugin_contributors-podpirate","plugin_committers-podpirate"],"banners":{"banner":"https:\/\/ps.w.org\/multisite-blog-alias\/assets\/banner-772x250.png?rev=2124013","banner_2x":"https:\/\/ps.w.org\/multisite-blog-alias\/assets\/banner-1544x500.png?rev=2124013","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/multisite-blog-alias\/assets\/icon-128x128.png?rev=2124013","icon_2x":"https:\/\/ps.w.org\/multisite-blog-alias\/assets\/icon-256x256.png?rev=2124013","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/multisite-blog-alias\/assets\/screenshot-1.png?rev=3046426","caption":"Network admin - Edit site. I completely messed up a few webservers to run the last test in the list!"}],"raw_content":"<!--section=description-->\n<p>WP Multisite plugin to maintain URL-redirects for Blogs.<\/p>\n\n<h3>Features<\/h3>\n\n<ul>\n<li>Permanent 301 Redirect to blogs main domain<\/li>\n<li>Painless installation and activation \u2013 no file access necessary.<\/li>\n<li>Checks domain status<\/li>\n<li>Supports UTF-8 Domains<\/li>\n<li><a href=\"https:\/\/wp-cli.org\/\">WP-Cli<\/a> commands<\/li>\n<\/ul>\n\n<h3>Usage<\/h3>\n\n<ol>\n<li><strong>Set up your DNS<\/strong>. Make sure your Domain points to your Wordpress installation. You can achieve this by either setting up an A- or CNAME-Record in your DNS configuration. Your webserver must be configured to handle requests on the given Domain.<\/li>\n<li>Under <strong>Network Admin \u2013 Sites<\/strong> edit the site and select the Alias Domains Tab.<\/li>\n<li>Enter the domain without <code>http<\/code> ao <code>\/<\/code> and click \"Add\".<\/li>\n<li>Click \"Check Status\" to see if it worked. If something went wrong you will see an error message.<\/li>\n<\/ol>\n\n<p>If you want to redirect with URL path appended (e.g. from <code>some-alias.tld\/some\/path<\/code> to <code>some-real-blog.tld\/some\/path<\/code>), add this to your <code>wp-config.php<\/code>:<\/p>\n\n<pre><code>define( 'WPMU_BLOG_ALIAS_REDIRECT_WITH_PATH', true );\n<\/code><\/pre>\n\n<h4>Status messages<\/h4>\n\n<p><strong>Warning: The domain matches the site URL of this blog:<\/strong> The Blog is using the domain name as Site URL.<\/p>\n\n<p><strong>Error: The domain is already used by another site:<\/strong> A different Blog is already using the domain as Site URL. Eiter Remove the alias from the sblog you are currently workin on, or from the other one.<\/p>\n\n<p><strong>The domain is unreachable:<\/strong> There is likely an error in your DNS or your Webserver configuration. Use <code>nslookup<\/code> from he command line or <a href=\"https:\/\/www.whatsmydns.net\/\">whatsmydns.net<\/a> to check the DNS-Settings.<\/p>\n\n<p><strong>The domain or a redirect does not point to this blog:<\/strong> Following all redirects did not end up on your WordPress-Site, but somewhere else. There is likely an error in your DNS or your Webserver configuration.<\/p>\n\n<h3>WP-CLI Examples<\/h3>\n\n<h3>Listing Domain aliases<\/h3>\n\n<p><strong>List alias domains for blog-id 123<\/strong><\/p>\n\n<pre><code>wp alias-domains list --blog_id=123\n<\/code><\/pre>\n\n<p><strong>Output minified json of all aliases<\/strong><\/p>\n\n<pre><code>wp alias-domains list --format=json --compact=2\n<\/code><\/pre>\n\n<p><strong>Output csv including the header row but omitting other messages into file<\/strong><\/p>\n\n<pre><code>wp alias-domains list --format=csv --compact &gt; alias-list.csv\n<\/code><\/pre>\n\n<h3>Add Domain Alias<\/h3>\n\n<pre><code>wp alias-domains add --blog_id=123 --domain_alias=quux.foobar.tld\n<\/code><\/pre>\n\n<h3>Remove Domain Alias<\/h3>\n\n<p><strong>Remove a specific alias<\/strong><\/p>\n\n<pre><code>wp alias-domains remove --domain_alias=quux.foobar.tld\n<\/code><\/pre>\n\n<p><strong>Remove all aliases for blog 123<\/strong><\/p>\n\n<pre><code>wp alias-domains remove --blog_id=123\n<\/code><\/pre>\n\n<h3>Testing Domain Aliases<\/h3>\n\n<pre><code>wp alias-domains test --domain_alias=quux.foobar.tld&lt;h3&gt;Plugin PHP-API&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>The plugin introduces two functions allowing you to add \/ remove a domain aliases from inside PHP.<\/p>\n\n<p><strong>Add Domain alias<\/strong><\/p>\n\n<pre><code>$result = alias_domain_add( $blog_id, 'quux.foobar.tld' );\nif ( is_wp_error( $result ) ) {\n    \/\/ handle error\n}\n<\/code><\/pre>\n\n<p><strong>Remove specific Domain alias<\/strong><\/p>\n\n<pre><code>$result = alias_domain_remove_by( 'domain_alias', 'quux.foobar.tld' );\nif ( is_wp_error( $result ) ) {\n    \/\/ handle error\n}\n<\/code><\/pre>\n\n<p><strong>Remove Domain aliases for a specific blog<\/strong><\/p>\n\n<pre><code>$result = alias_domain_remove_by( 'blog_id', 123 );\nif ( is_wp_error( $result ) ) {\n    \/\/ handle error\n}&lt;h3&gt;Development&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>Please head over to the source code <a href=\"https:\/\/github.com\/mcguffin\/multisite-blog-alias\">on Github<\/a>.<\/p>\n\n<!--section=installation-->\n<p>Follow the standard <a href=\"http:\/\/codex.wordpress.org\/Managing_Plugins\">WordPress plugin installation procedere<\/a>.<\/p>\n\n<p>The installer will:\n1. Create a database table <code>{$table_prefix}alias_domains<\/code>\n2. Create a file <code>wp-content\/sunrise.php<\/code> or append its PHP to it, if the file already exists.\n3. Insert <code>define( 'SUNRISE', true );<\/code> in your wp-config.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id='i%20found%20a%20bug.%20where%20should%20i%20post%20it%3F'><h3>I found a bug. Where should I post it?<\/h3><\/dt>\n<dd><p>Please use the issues section in the <a href=\"https:\/\/github.com\/mcguffin\/multisite-blog-alias\/issues\">GitHub-Repository<\/a>.<\/p>\n\n<p>I will most likely not maintain the forum support forum on wordpress.org. Anyway, other users might have an answer for you, so it's worth a shot.<\/p><\/dd>\n<dt id='i%27d%20like%20to%20suggest%20a%20feature.%20where%20should%20i%20post%20it%3F'><h3>I'd like to suggest a feature. Where should I post it?<\/h3><\/dt>\n<dd><p>Please post an issue in the <a href=\"https:\/\/github.com\/mcguffin\/multisite-blog-alias\/issues\">GitHub-Repository<\/a><\/p><\/dd>\n<dt id='will%20you%20anwser%20support%20requests%20by%20email%3F'><h3>Will you anwser support requests by email?<\/h3><\/dt>\n<dd><p>No.<\/p><\/dd>\n<dt id='the%20plugin%20works%20pretty%20well%20for%20me.%20any%20way%20i%20can%20show%20my%20appreciation%3F'><h3>The plugin works pretty well for me. Any way I can show my appreciation?<\/h3><\/dt>\n<dd><p>Thanks! As a well trained person living in a rich country there is little more I need.\nThe majority on the other hand is not doing very well. And because this plugin is about redirection, I'd like to point your attention to the several refugee crises taking place everwhere around the world.<\/p>\n\n<p>If my little piece of software was able to help you, please consider helping others and place a donation at the <a href=\"https:\/\/donate.unhcr.org\/\">UNHCR<\/a>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>New Option: Redirect \/wp-admin\/ and \/wp-login.php<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Status Check: Test SSL status and show redirects<\/li>\n<li>Introduce PHP functions <code>alias_domain_add()<\/code> and <code>alias_domain_remove_by()<\/code><\/li>\n<li>CLI: Introduce site_id parameter<\/li>\n<li>Refactor: Error messages<\/li>\n<\/ul>\n\n<h4>1.1.9<\/h4>\n\n<ul>\n<li>Fix: PHP 8.2 deprecation notices<\/li>\n<li>Fix: Missing network admin page title<\/li>\n<\/ul>\n\n<h4>1.1.8<\/h4>\n\n<ul>\n<li>Enhancement: Handle <code>ms_network_not_found<\/code><\/li>\n<\/ul>\n\n<h4>1.1.7<\/h4>\n\n<ul>\n<li>Fixed main blog redirection<\/li>\n<li>Test with PHP 8<\/li>\n<li>Test with WP 5.8<\/li>\n<\/ul>\n\n<h4>1.1.6<\/h4>\n\n<ul>\n<li>Feature: auto-remove blog aliases when a blog is being deleted<\/li>\n<li>Fix: domain check returned false negative if network admin is under ssl and blog URL is not<\/li>\n<li>Fix: Model class didn't return insert id. As a result action <code>blog_alias_created<\/code> was called with a wrong argument<\/li>\n<\/ul>\n\n<h4>1.1.5<\/h4>\n\n<ul>\n<li>Plugin-API: introduce filter <code>blog_alias_create_data<\/code> and actions <code>blog_alias_created<\/code>, <code>blog_alias_delete<\/code>, <code>blog_alias_deleted<\/code>, <code>blog_alias_delete_multiple<\/code> and <code>blog_alias_deleted_multiple<\/code><\/li>\n<li>Fix: redirect after activation in WP-Cli environment<\/li>\n<li>Fix: php warning __wakeup magic method<\/li>\n<li>Fix: Sunrise and wp-config.php not changed after activation<\/li>\n<\/ul>\n\n<h4>1.1.4<\/h4>\n\n<ul>\n<li>Security hardening<\/li>\n<li>Tested up to WordPress 5.6<\/li>\n<\/ul>\n\n<h4>1.1.3<\/h4>\n\n<ul>\n<li>Fix: Wrong table updated after upgrade<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Fix: Not installing on Mysql &lt;=5.6 \/ InnoDB<\/li>\n<li>Fix: Support domain names with up to 253 characters<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Fix: Fatal error on entwork activation<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>More input validation<\/li>\n<li>Drop support for PHP 5.5<\/li>\n<li>Code Refactoring<\/li>\n<li>Fix: Domain name not visible when alias was created with wp-cli<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Security hardening<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Add Option \"Redirect with Path\" to network settings page<\/li>\n<li>Introduce wp-cli --field parameter<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Add support for utf8 domain names<\/li>\n<li>Fix PHP strict warning<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Send <code>X-Redirect-By<\/code> HTTP Header<\/li>\n<li>Option to redirect with path using constant <code>WPMU_BLOG_ALIAS_REDIRECT_WITH_PATH<\/code>.<\/li>\n<li>Fix: PHP Fatal in sunrise.php if formatting functions are not present<\/li>\n<li>Fix: Make sure Status check ah\u00b4jax is loaded from Network-URL<\/li>\n<li>Validation: Make sure only hostnames can be entered<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Set up redirects for Multisite-Blogs.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/106617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=106617"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/podpirate"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=106617"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=106617"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=106617"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=106617"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=106617"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=106617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}