Title: Multiple Domain
Author: Javik
Published: <strong>July 29, 2016</strong>
Last modified: April 11, 2021

---

Search plugins

![](https://ps.w.org/multiple-domain/assets/banner-772x250.png?rev=2502840)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/multiple-domain/assets/icon-256x256.png?rev=2502840)

# Multiple Domain

 By [Javik](https://profiles.wordpress.org/sirjavik/)

[Download](https://downloads.wordpress.org/plugin/multiple-domain.1.0.7.zip)

 * [Details](https://xho.wordpress.org/plugins/multiple-domain/#description)
 * [Reviews](https://xho.wordpress.org/plugins/multiple-domain/#reviews)
 *  [Installation](https://xho.wordpress.org/plugins/multiple-domain/#installation)
 * [Development](https://xho.wordpress.org/plugins/multiple-domain/#developers)

 [Support](https://wordpress.org/support/plugin/multiple-domain/)

## Description

Important: This plugin has a new maintainer. So the plugin will now be active developed
again, and it’s now part of [goINPUT](https://goinput.de).

Multiple Domain allows you having more than one domain in a single WordPress installation.
This plugin doesn’t support
 more than one theme or advanced customizations for 
each domain. It’s only intended to enable constant navigation under many domains.
For a more complex setup, there is [WordPress Multisite (MU)](https://codex.wordpress.org/Create_A_Network).

When there is more than one domain set in your host, all links and resources will
point to the default domain. This is
 the default WordPress behavior. With Multiple
Domain installed and properly configured, it’ll update all link on the fly. This
way, the user navigation will be end-to-end under the same domain.

You can also set an optional base URL. If you want only a set of URL’s available
under a given domain, you can use this
 restriction.

Additionally, a language can be set for each domain. The language will be used to
add `<link>` tags with `hreflang`
 attribute to document head. This is for SEO purposes.

## Installation

Follow the steps below to install the plugin:

 1. Upload the plugin files to the `/wp-content/plugins/multiple-domain` directory,
    or install the plugin through the
     WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. Use the Settings -> General screen to configure your additional domains.

## FAQ

### How can I help the plugin development?

Feel free to open a [pull request](https://github.com/goINPUT-IT-Solutions/multiple-domain/pulls)
to address any of the
 [issues](https://github.com/goINPUT-IT-Solutions/multiple-domain/issues)
reported by the plugin users. In case you have questions on how to fix or the best
approach, start a discussion on the appropriate thread.

If you want to add a new feature, please [open an issue](https://github.com/goINPUT-IT-Solutions/multiple-domain/issues/new)

explaining the feature and how it would help the users before start writing your
code.

**Donations**

If you find this plugin helpful, you can support the work involved buying me a coffee,
beer or a Playstation 4 game.
 You can send donations over PayPal to paypal@goinput.
de.

### Does this plugin set extra domains within my host?

No. You have to set additional domains, DNS, and everything else to use this plugin.

### Can I have a different theme/content/plugins for each domain?

Nope. If you want a complex set up like this, you may be interested in WordPress
Multisite. It’s delivered with every
 WordPress installation since 3.0, you can 
find more info here: https://codex.wordpress.org/Create_A_Network.

### There is a way to add domain based logic to my themes?

Absolutely. You can use the `MULTIPLE_DOMAIN_DOMAIN` and `MULTIPLE_DOMAIN_ORIGINAL_DOMAIN`
constants to get the current
 and original domains. Just notice that since the value
of the first one is checked against plugin settings, it may not reflect the actual
domain in `HTTP_HOST` element from `$_SERVER` or user’s browser. They also may include
the host port when it’s different than 80 (default HTTP port) or 443 (default HTTPS
port).

**Notice**: in prior versions these constants were wrongly prefixed with `MULTPLE_`,
missing the “I”. The old constants
 are now deprecated. They still available for
backcompat but will be removed in future releases.

### Can I create a custom access restriction logic for each domain?

Yes. You can use the `multiple_domain_redirect` action to do that. Please check

https://github.com/straube/multiple-domain/issues/2 for an example on how to do 
that.

### Can I get the language associated with the current domain?

Yes. You can use the `MULTIPLE_DOMAIN_DOMAIN_LANG` constant to get the language 
associated with the current domain. Keep
 in mind the value in this constant doesn’t
necessarily reflect the actual user language or locale. This is just the language
set in the plugin config. Also notice the language may be `null`.

**Notice**: in prior versions these constants were wrongly prefixed with `MULTPLE_`,
missing the “I”. The old constants
 are now deprecated. They still available for
backcompat but will be removed in future releases.

### Can I show the current domain in the content of posts or pages?

Yes. There is a shortcode available for that. Just add `[multiple_domain]` to the
post/page and it’ll be replaced by
 the current domain when viewing the content.
You can write things like “Welcome to [multiple_domain]!”, which would be rendered
as “Welcome to mydomain.com!”.

### What domains should I add to the plugin setup?

Any domain you’re site is served from must be added to the plugin configuration.
Even `www` variations and the original
 domain where your WordPress was installed
in must be added. You’ll probably see some unexpected output when accessing the 
site from a non-mapped domain.

### Can I disable `hreflang` tags output even for the original domain?

Yes. You may notice that even if you don’t set a language for any domain, you still
get a default `hreflang` tag in
 your page head. To disable this behavior, follow
the instructions from https://github.com/straube/multiple-domain/issues/51.

### I locked myself out, and what am I doing now?

Under certain circumstances, in the case of a wrong configuration, you may not be
able to log in to the admin area
 and your page will be redirected. In this case,
there are two ways to solve this.

 1. Delete the plugin directory `wp-content/plugins/multiple-domain`. You should be
    able to do that from the hosting
     panel, from an FTP client, or via SSH. The downside
    of this technique is that it won’t be possible to install the plugin again since
    the configuration will still be in the database.
 2. Remove the plugin configuration from the database using the following SQL query`
    DELETE FROM {YOUR-PREFIX}_options
     WHERE option_name LIKE 'multiple-domain-%'
    ;(
    Remember to replace the prefix from your own table name). This can be
     done from
    the hosting panel when PHPMyAdmin is available or using a MySQL client.

## Reviews

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

### 󠀁[tailscale 100 IP works](https://wordpress.org/support/topic/tailscale-100-ip-works/)󠁿

 [RaymondDay](https://profiles.wordpress.org/raymondday/) July 11, 2024

Wow this is super. I looked it up and installed a Plugins name “Multiple Domain”
and said “Add domain” and typed in the IP of tailscale the one that starts with 
100 and went on my WordPress app on my cellphone and said add a site and typed that
100 IP /blog and it works! Turn off my Wi-Fi just to test and it still works That’s
grate just what I wanted. I can still get to it on my LAN PC too. Maybe some how
post this so it can help others.

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

### 󠀁[Excellent plugin](https://wordpress.org/support/topic/excellent-plugin-9130/)󠁿

 [Bence Szalai](https://profiles.wordpress.org/grapestain/) May 3, 2024

It works great in multiple installations I manage. The latest one runs WordPress
6.5.2, so don’t worry about the warning: This plugin hasn’t been tested with the
latest 3 major releases of WordPress. This plugin uses standard WP API and is very
stable despite the age. Great work!

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

### 󠀁[Works great](https://wordpress.org/support/topic/works-great-8742/)󠁿

 [AndreCarvalho](https://profiles.wordpress.org/andrecarvalho/) March 23, 2023

This is exactly what I was looking for, it allows you to have more than one domain
showing the exact same content and with a rewrite (not redirect). Has others have
pointed out, this is great for local development and then publishing in the production
env. Thank you to the authors for the great work.

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

### 󠀁[Saving a lot of frustration](https://wordpress.org/support/topic/saving-a-lot-of-frustration/)󠁿

 [tornevall](https://profiles.wordpress.org/tornevall/) December 22, 2022

Having a staging page separated from production, but in the end with same databases,
switching to that staging site without being redirected back to a production URL
is a total lifesaver!

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

### 󠀁[Perfect solution for local development](https://wordpress.org/support/topic/perfect-solution-for-local-development/)󠁿

 [tobiasroeder](https://profiles.wordpress.org/tobiasroeder/) March 17, 2022

This Plugin is a perfect solution when I’m developing on my local machine and want
to share the website on my local network without reinstalling with my local IP address.
Now I can simply use my custom local domain name and my local IP address and simply
share the website on my local network. Awesome plugin, highly recommended.

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

### 󠀁[Great](https://wordpress.org/support/topic/great-13824/)󠁿

 [BestRanger](https://profiles.wordpress.org/bestranger/) October 5, 2021

Really helpfull plugin and great for SEO too.

 [ Read all 28 reviews ](https://wordpress.org/support/plugin/multiple-domain/reviews/)

## Contributors & Developers

“Multiple Domain” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Javik ](https://profiles.wordpress.org/sirjavik/)
 *   [ mrelliwood ](https://profiles.wordpress.org/mrelliwood/)
 *   [ goINPUT IT Solutions ](https://profiles.wordpress.org/goinput/)
 *   [ Gustavo Straube ](https://profiles.wordpress.org/gustavostraube/)
 *   [ cyberaleks ](https://profiles.wordpress.org/cyberaleks/)
 *   [ João Faria ](https://profiles.wordpress.org/jffaria/)

“Multiple Domain” has been translated into 2 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/multiple-domain/contributors)
for their contributions.

[Translate “Multiple Domain” into your language.](https://translate.wordpress.org/projects/wp-plugins/multiple-domain)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/multiple-domain/), 
check out the [SVN repository](https://plugins.svn.wordpress.org/multiple-domain/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/multiple-domain/)
by [RSS](https://plugins.trac.wordpress.org/log/multiple-domain/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.7

 * Changed the author to the new one.
 * Tested suport for WP 5.7

#### 1.0.6

 * Fix URI generated for canonical tag.

#### 1.0.5

 * Fixed issue with system routes when a base path is defined.

#### 1.0.4

 * Fixed assertions in admin views.

#### 1.0.3

 * Fixed XSS vulnerability in canonical/alternate tags.

#### 1.0.2

 * Added low memory option. (Refer to https://github.com/straube/multiple-domain/
   issues/45 on how to enable it)
 * Constants starting with `MULTPLE_` are now deprecated. They have a matching `
   MULTIPLE_` prefixed constant.
 * Fixed constants starting with `MULTPLE_`, changed to `MULTIPLE`.

#### 1.0.1

 * Fixed issue with regex used in domain replacement.

#### 1.0.0

 * Locked out instructions to readme file.
 * API to programmatically change the domains list.
 * Don’t add canonical link if settings are `false`.

#### 0.11.2

 * FAQ about removal of `hreflang` tags.
 * Fixed bug in domain replacement when it contains a slash (the regex delimiter).
 * Fixed issue in the domain replacement regex.

#### 0.11.1

 * Fixed URI validation when there is a domain’s base restriction.

#### 0.11.0

 * Add CHANGELOG.md file.
 * Added option to enable canonical tags.
 * Added `%%multiple_domain%%` advanced variable for Yoast.
 * Moved WordPress admin features to a separate class.
 * Renamed hreflang related methods.
 * Inline documentation review.
 * Minor refactoring.
 * Fixed issue with domain replacement.

#### 0.10.3

 * Added public method to retrieve a given (or current) domain base path: `getDomainBase(
   $domain = null)`.
 * Minor code refactoring.

#### 0.10.2

 * Fix minor notice message when loading the non-mapped original domain.
 * Added FAQ about plugin settings and domains.

#### 0.10.1

 * Fix bug introduced in 0.10.0 with setups where the original domain is not present
   in the plugin settings.

#### 0.10.0

 * Fix #31: Don’t add SSL when accessing via a Tor domain name
 * Moved HTML to view files.

#### 0.9.0

 * Fixed bug in backward compatibility logic.
 * Added a class to `<body>` tag containing the domain name (e.g. `multipled-domain-
   name-tld`) to allow front-end customizations.

#### 0.8.7

 * Loading Multiple Domain before other plugins to fix issue with paths.
 * Fix #38: Missing locales on language list (this issue was reopened and now it’s
   fixed)
 * Refactored `initAttributes` method.

#### 0.8.6

 * Fix #39: Rolling back changes introduced in 0.8.4 and 0.8.5 regarding to avoid
   URL changes in the WP admin.

#### 0.8.5

 * Fixed an issue introduced in 0.8.4 that breaks the admin URLs.
 * Fix #38: Missing locales on language list
 * Add `[multiple_domain]` shortcode to show the current language.

#### 0.8.4

 * Fix: #36 Wrong host in URLs returned by the JSON API
 * Using singleton pattern for main plugin class.
 * Avoiding URL changes in the admin panel.

#### 0.8.3

 * Fix: #34 hreflang tag error

#### 0.8.2

 * Fix: #32 Image URLs not being re-written properly via Tor.

#### 0.8.1

 * Fix: #23 Undefined index when using wp-cli.

#### 0.8.0

 * Moved `MultipleDomain` class to its own file.
 * Fix: #14 Remove `filter_input` from plugin.
 * Attempt to fix #22.
 * Added `MULTIPLE_DOMAIN_DOMAIN_LANG` constant for theme/plugin customization.
 * Fix: #21 No ‘Access-Control-Allow-Origin’ header is present on the requested 
   resource

#### 0.7.1

 * Make the plugin compatible with PHP 5.4 again.

#### 0.7

 * Code review/refactoring.
 * Added activation hook to fix empty settings bug.

#### 0.6

 * Fix: #11 Redirect to original domain if SSL/https.

#### 0.5

 * Added http/https for alternate link.

#### 0.4

 * Fixed resolving host name to boolean.
 * Added Reflang links to head for SEO purpose. E.g.

#### 0.3

 * Fixed bug when removing the port from current domain.
 * Added `MULTIPLE_DOMAIN_ORIGINAL_DOMAIN` constant to hold the original WP home
   domain.
 * Allowing developers to create custom URL restriction logic through `multiple_domain_redirect`
   action.
 * Improved settings interface.

#### 0.2

 * Improved port verification.
 * Added `MULTIPLE_DOMAIN_DOMAIN` constant for theme/plugin customization.
 * And, last but not least, code refactoring.

#### 0.1

This is the first release. It supports setting domains and an optional base URL 
for each one.

## Meta

 *  Version **1.0.7**
 *  Last updated **5 years ago**
 *  Active installations **10,000+**
 *  WordPress version ** 4.0 or higher **
 *  Tested up to **5.7.15**
 *  Languages
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/multiple-domain/), [Dutch](https://nl.wordpress.org/plugins/multiple-domain/),
   and [English (US)](https://wordpress.org/plugins/multiple-domain/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/multiple-domain)
 * Tags
 * [domains](https://xho.wordpress.org/plugins/tags/domains/)[multiple](https://xho.wordpress.org/plugins/tags/multiple/)
   [redirect](https://xho.wordpress.org/plugins/tags/redirect/)
 *  [Advanced View](https://xho.wordpress.org/plugins/multiple-domain/advanced/)

## Ratings

 4.8 out of 5 stars.

 *  [  26 5-star reviews     ](https://wordpress.org/support/plugin/multiple-domain/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/multiple-domain/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/multiple-domain/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/multiple-domain/reviews/?filter=2)
 *  [  1 1-star review     ](https://wordpress.org/support/plugin/multiple-domain/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/multiple-domain/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/multiple-domain/reviews/)

## Contributors

 *   [ Javik ](https://profiles.wordpress.org/sirjavik/)
 *   [ mrelliwood ](https://profiles.wordpress.org/mrelliwood/)
 *   [ goINPUT IT Solutions ](https://profiles.wordpress.org/goinput/)
 *   [ Gustavo Straube ](https://profiles.wordpress.org/gustavostraube/)
 *   [ cyberaleks ](https://profiles.wordpress.org/cyberaleks/)
 *   [ João Faria ](https://profiles.wordpress.org/jffaria/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/multiple-domain/)