Title: Multisite Blog Alias
Author: podpirate
Published: <strong>16 iulie 2019</strong>
Last modified: 5 decembrie 2025

---

Caută module

![](https://ps.w.org/multisite-blog-alias/assets/banner-772x250.png?rev=2124013)

![](https://ps.w.org/multisite-blog-alias/assets/icon-256x256.png?rev=2124013)

# Multisite Blog Alias

 De [podpirate](https://profiles.wordpress.org/podpirate/)

[Descarcă](https://downloads.wordpress.org/plugin/multisite-blog-alias.1.2.1.zip)

 * [Detalii](https://ro.wordpress.org/plugins/multisite-blog-alias/#description)
 * [Recenzii](https://ro.wordpress.org/plugins/multisite-blog-alias/#reviews)
 *  [Instalare](https://ro.wordpress.org/plugins/multisite-blog-alias/#installation)
 * [Dezvoltare](https://ro.wordpress.org/plugins/multisite-blog-alias/#developers)

 [Suport](https://wordpress.org/support/plugin/multisite-blog-alias/)

## Descriere

WP Multisite plugin to maintain URL-redirects for Blogs.

### Features

 * Permanent 301 Redirect to blogs main domain
 * Painless installation and activation – no file access necessary.
 * Checks domain status
 * Supports UTF-8 Domains
 * [WP-Cli](https://wp-cli.org/) commands

### Usage

 1. **Set up your DNS**. 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.
 2. Under **Network Admin – Sites** edit the site and select the Alias Domains Tab.
 3. Enter the domain without `http` ao `/` and click „Add”.
 4. Click „Check Status” to see if it worked. If something went wrong you will see 
    an error message.

If you want to redirect with URL path appended (e.g. from `some-alias.tld/some/path`
to `some-real-blog.tld/some/path`), add this to your `wp-config.php`:

    ```
    define( 'WPMU_BLOG_ALIAS_REDIRECT_WITH_PATH', true );
    ```

#### Status messages

**Warning: The domain matches the site URL of this blog:** The Blog is using the
domain name as Site URL.

**Error: The domain is already used by another site:** 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.

**The domain is unreachable:** There is likely an error in your DNS or your Webserver
configuration. Use `nslookup` from he command line or [whatsmydns.net](https://www.whatsmydns.net/)
to check the DNS-Settings.

**The domain or a redirect does not point to this blog:** 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.

### WP-CLI Examples

### Listing Domain aliases

**List alias domains for blog-id 123**

    ```
    wp alias-domains list --blog_id=123
    ```

**Output minified json of all aliases**

    ```
    wp alias-domains list --format=json --compact=2
    ```

**Output csv including the header row but omitting other messages into file**

    ```
    wp alias-domains list --format=csv --compact > alias-list.csv
    ```

### Add Domain Alias

    ```
    wp alias-domains add --blog_id=123 --domain_alias=quux.foobar.tld
    ```

### Remove Domain Alias

**Remove a specific alias**

    ```
    wp alias-domains remove --domain_alias=quux.foobar.tld
    ```

**Remove all aliases for blog 123**

    ```
    wp alias-domains remove --blog_id=123
    ```

### Testing Domain Aliases

    ```
    wp alias-domains test --domain_alias=quux.foobar.tld<h3>Plugin PHP-API</h3>
    ```

The plugin introduces two functions allowing you to add / remove a domain aliases
from inside PHP.

**Add Domain alias**

    ```
    $result = alias_domain_add( $blog_id, 'quux.foobar.tld' );
    if ( is_wp_error( $result ) ) {
        // handle error
    }
    ```

**Remove specific Domain alias**

    ```
    $result = alias_domain_remove_by( 'domain_alias', 'quux.foobar.tld' );
    if ( is_wp_error( $result ) ) {
        // handle error
    }
    ```

**Remove Domain aliases for a specific blog**

    ```
    $result = alias_domain_remove_by( 'blog_id', 123 );
    if ( is_wp_error( $result ) ) {
        // handle error
    }<h3>Development</h3>
    ```

Please head over to the source code [on Github](https://github.com/mcguffin/multisite-blog-alias).

## Capturi ecran

 * [[
 * Network admin – Edit site. I completely messed up a few webservers to run the
   last test in the list!

## Instalare

Follow the standard [WordPress plugin installation procedere](https://codex.wordpress.org/Managing_Plugins).

The installer will:
 1. Create a database table `{$table_prefix}alias_domains` 2.
Create a file `wp-content/sunrise.php` or append its PHP to it, if the file already
exists. 3. Insert `define( 'SUNRISE', true );` in your wp-config.

## Întrebări frecvente

### I found a bug. Where should I post it?

Please use the issues section in the [GitHub-Repository](https://github.com/mcguffin/multisite-blog-alias/issues).

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.

### I’d like to suggest a feature. Where should I post it?

Please post an issue in the [GitHub-Repository](https://github.com/mcguffin/multisite-blog-alias/issues)

### Will you anwser support requests by email?

No.

### The plugin works pretty well for me. Any way I can show my appreciation?

Thanks! As a well trained person living in a rich country there is little more I
need.
 The 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.

If my little piece of software was able to help you, please consider helping others
and place a donation at the [UNHCR](https://donate.unhcr.org/).

## Recenzii

![](https://secure.gravatar.com/avatar/d243c95df571db785649246aa036b5c16c30e9dc0dbcf2fc24297b1a5d6eebd8?
s=60&d=retro&r=g)

### 󠀁[Feature Complete yet Simple to Use (Great for WP Multi-Site Network „www.”)](https://wordpress.org/support/topic/feature-complete-yet-simple-to-use/)󠁿

 [KZeni](https://profiles.wordpress.org/kzeni/) 30 mai 2024

This let me do exactly what I needed to do in the most ideal/streamlined/WordPress-
integrated way I could imagine it being implemented (it can be so annoying when 
plugins create their own admin page layout, tables, tabs, styles, etc. when they
could’ve/should’ve just used what WordPress offers for those as standard, like this
plugin has done.) It’s flexible depending on certain needs & even has WP-CLI commands
without having feature creep of stuff that’s unrelated to this plugin’s core goal(
also on GitHub and doesn’t have any ads/promos/upgrades like other plugins.) Even
the „Check Status” tool when viewing a site’s domain alias(es) is capable (checks
many different possible situations [great to see the whatsmydns.net mention for 
if/when a DNS change might be needed]) yet concise to then be addressed swiftly.
I simply network-enabled the plugin, edited the site details to add the Alias Domain(
s), and it worked! This plugin really checked off every box to have this be a top-
recommended plugin for this (now more people just need to find out about this & 
use it instead of hard-coding redirects/rewrites or using plugins that, simply put,
aren’t as nice as this one. Honestly, this seems like a go-to if/when a WordPress
multi-site network has a site on it that wants to use „www.” as the primary domain
of the site while then not including „www.” has WordPress wanting to show either
the „register a site” or „you cannot register a site here” since it’s considered
as a different subdomain & therefore a different site (even though a site that doesn’t
want to use „www.” still resolves properly when that is provided in the URL)… maybe
WordPress core will make that no longer needing to be manually accommodated, but
this is now my favored way to handle this (replacing rewrites/redirects [especially
if/when on nginx or some other hosting setup that might be more restrictive where
WordPress should probably just handle it.]) Even the „Donate to this plugin” link
for this plugin’s details on WP.org is currently going to UN Refugees instead of
themselves. This plugin has really earned its praise.

![](https://secure.gravatar.com/avatar/a7d4b46affc96327515f86afb3cc731a80ae03d4ff463d8bff9733d7ea533f8d?
s=60&d=retro&r=g)

### 󠀁[Just works!](https://wordpress.org/support/topic/just-works-757/)󠁿

 [dichternebel](https://profiles.wordpress.org/dichternebel/) 16 octombrie 2023

Thanks for sharing! Works like a charm!

![](https://secure.gravatar.com/avatar/7f7c11769c4c764edce34756d74d14e6c47032cc68583bd1755a3de689919278?
s=60&d=retro&r=g)

### 󠀁[Did the trick, thanks](https://wordpress.org/support/topic/did-the-trick-thanks/)󠁿

 [Philip Sole](https://profiles.wordpress.org/philsole/) 22 iulie 2022

Simple and worked great.

![](https://secure.gravatar.com/avatar/1de2cee86ecaf7cf1b797071f80b781265e7ccdcbb1675edff99b723375b9b09?
s=60&d=retro&r=g)

### 󠀁[Excellent Work](https://wordpress.org/support/topic/excellent-work-258/)󠁿

 [cuteantonyraj](https://profiles.wordpress.org/cuteantonyraj/) 12 august 2020

Thanks for this plugin

![](https://secure.gravatar.com/avatar/17178c6edad9cd37f5ce48dc68d2cd47e899aabe8784107968acefc1bd8245de?
s=60&d=retro&r=g)

### 󠀁[Works like charm](https://wordpress.org/support/topic/works-like-charm-106/)󠁿

 [lipcan](https://profiles.wordpress.org/lipcan/) 15 februarie 2020

Thank you. Keep doing the great job.

 [ Citește toate cele 5 recenzii ](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/)

## Contributori și dezvoltatori

„Multisite Blog Alias” este un software open-source. La acest modul au contribuit
următoarele persoane.

Contributori

 *   [ podpirate ](https://profiles.wordpress.org/podpirate/)

[Tradu „Multisite Blog Alias” în limba ta.](https://translate.wordpress.org/projects/wp-plugins/multisite-blog-alias)

### Te interesează dezvoltarea?

[Răsfoiește codul](https://plugins.trac.wordpress.org/browser/multisite-blog-alias/),
vezi [depozitarul SVN](https://plugins.svn.wordpress.org/multisite-blog-alias/),
sau abonează-te la [jurnalul de dezvoltare](https://plugins.trac.wordpress.org/log/multisite-blog-alias/)
prin [RSS](https://plugins.trac.wordpress.org/log/multisite-blog-alias/?limit=100&mode=stop_on_copy&format=rss).

## Istoric modificări

#### 1.2.1

 * New Option: Redirect /wp-admin/ and /wp-login.php

#### 1.2.0

 * Status Check: Test SSL status and show redirects
 * Introduce PHP functions `alias_domain_add()` and `alias_domain_remove_by()`
 * CLI: Introduce site_id parameter
 * Refactor: Error messages

#### 1.1.9

 * Fix: PHP 8.2 deprecation notices
 * Fix: Missing network admin page title

#### 1.1.8

 * Enhancement: Handle `ms_network_not_found`

#### 1.1.7

 * Fixed main blog redirection
 * Test with PHP 8
 * Test with WP 5.8

#### 1.1.6

 * Feature: auto-remove blog aliases when a blog is being deleted
 * Fix: domain check returned false negative if network admin is under ssl and blog
   URL is not
 * Fix: Model class didn’t return insert id. As a result action `blog_alias_created`
   was called with a wrong argument

#### 1.1.5

 * Plugin-API: introduce filter `blog_alias_create_data` and actions `blog_alias_created`,`
   blog_alias_delete`, `blog_alias_deleted`, `blog_alias_delete_multiple` and `blog_alias_deleted_multiple`
 * Fix: redirect after activation in WP-Cli environment
 * Fix: php warning __wakeup magic method
 * Fix: Sunrise and wp-config.php not changed after activation

#### 1.1.4

 * Security hardening
 * Tested up to WordPress 5.6

#### 1.1.3

 * Fix: Wrong table updated after upgrade

#### 1.1.2

 * Fix: Not installing on Mysql <=5.6 / InnoDB
 * Fix: Support domain names with up to 253 characters

#### 1.1.1

 * Fix: Fatal error on entwork activation

#### 1.1.0

 * More input validation
 * Drop support for PHP 5.5
 * Code Refactoring
 * Fix: Domain name not visible when alias was created with wp-cli

#### 1.0.4

 * Security hardening

#### 1.0.3

 * Add Option „Redirect with Path” to network settings page
 * Introduce wp-cli –field parameter

#### 1.0.2

 * Add support for utf8 domain names
 * Fix PHP strict warning

#### 1.0.1

 * Send `X-Redirect-By` HTTP Header
 * Option to redirect with path using constant `WPMU_BLOG_ALIAS_REDIRECT_WITH_PATH`.
 * Fix: PHP Fatal in sunrise.php if formatting functions are not present
 * Fix: Make sure Status check ah´jax is loaded from Network-URL
 * Validation: Make sure only hostnames can be entered

#### 1.0.0

 * Initial release

## Meta

 *  Versiunea **1.2.1**
 *  Ultima actualizare **Acum 4 luni**
 *  Instalări active: **Mai puțin de 10**
 *  Versiune WordPress ** 4.8 sau mai recentă **
 *  Testat până la **6.9.4**
 *  Versiune PHP ** 7.4 sau mai recentă **
 *  Limbă
 * [English (US)](https://wordpress.org/plugins/multisite-blog-alias/)
 * Etichete
 * [domain](https://ro.wordpress.org/plugins/tags/domain/)[multisite](https://ro.wordpress.org/plugins/tags/multisite/)
   [network](https://ro.wordpress.org/plugins/tags/network/)[redirect](https://ro.wordpress.org/plugins/tags/redirect/)
 *  [Vizualizare avansată](https://ro.wordpress.org/plugins/multisite-blog-alias/advanced/)

## Evaluări

 5 din 5 stele.

 *  [  5 5 – recenzii (stele)     ](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/?filter=5)
 *  [  0 4 – recenzii (stele)     ](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/?filter=4)
 *  [  0 3 – recenzii (stele)     ](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/?filter=3)
 *  [  0 2 – recenzii (stele)     ](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/?filter=2)
 *  [  0 1 – recenzii (stele)     ](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/#new-post)

[Vezi toate recenziile](https://wordpress.org/support/plugin/multisite-blog-alias/reviews/)

## Contributori

 *   [ podpirate ](https://profiles.wordpress.org/podpirate/)

## Suport

Ai ceva de zis? Ai nevoie de ajutor?

 [Vezi forumul pentru suport](https://wordpress.org/support/plugin/multisite-blog-alias/)

## Donează

Vrei să sprijini dezvoltarea acestui modul?

 [ Donează pentru acest modul ](https://donate.unhcr.org/)