I have come across a need of mapping multiple domain into single instance of WordPress installation for my blog “” & “”.  Then I did a search on the net, I found lot of references and plugins for single WordPress instance for multiple blog site within; take a look on ‘‘, but not for my need!

There are multiple ways to achieve multiple domain into single wordpress installation (sharing everything except domain name).  I thought to create a blog post around these activities, perhaps it will benefit someone!

Approach Taken & Implemented

Below are the steps I followed for my blog.

  • Installed the WordPress into parent domain ‘
  • Configured various plugins for my blog
  • Pointed second domain ‘’ into parent domain IP through A record in DNS zone editor
  • Edited ‘wp-config.php‘ for two domain names according while accessing i.e. to reflect Site URL and Site Home to respectively

Editing wp-config.php

  • Go to WordPress installed root directory and look for wp-config.php file
  • Place below lines after the “table_prefix” line (order is very important in wp-config.php, more info)
 * Handle multi domain into single instance of wordpress installation
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
  • Go to wordpress admin and take a look at ‘Settings -> General‘. You will have ‘WordPress Address (URL) and Site Address (URL)‘ will be in disabled state.  It means your wordpress installation dynamic enoungh to accomadate both domain address.
Wordpress Admin -> Settings -> General

Wordpress Admin -> Settings -> General


That’s it, now your WordPress instance have been enabled with multiple domain address.  I have shared the approach and step I followed for my blog. Make use of it!
Tagged with →  
  • Adam Wadsworth

    Absolutely spot on dude, thanks for this snippet just used on a clients website, Saved me so much hassle figuring this out myself.

  • ismael

    Thank you very much, that’s what I was looking for!!

  • Brent Wallace

    Hi. I plan to try this, I hope it works. Are you limited to only TWO (2) domain names? Or could you use three or more? Thank you!

    • Jeevanandam M.

      @Brent Wallace – It’s possible to map more than one name dynamically. It’s not limited to two.


  • Jeevanandam M.

    It depends, for example serving similar content from different websites does affects SEO. Let’s you have more than one regional domain names for your websites with 301 redirects, will not affect SEO.


  • Raz M

    Thanks a lot :-) Exactly what I was looking for.

  • Will Lanni

    To clarify this: in your graphic above, you have written into both the WordPress Address and the Site Address. Did you actually set this so that the .com is in the WordPress address and the .mobi is written into the Site Address?

    • Jeevanandam M.

      @willlanni:disqus Once we use above code snippet from article. WordPress will automatically disables ‘entering URL from settings page’, since its become dynamic to accommodate .com and .mobi domains as described above.


      • Will Lanni

        Oooh got it. Yeah, I did notice that it was disabled, now I get what you wrote.

        So your database is set up initially using the primary domain (… and then it just picks them up from the DNS zone editor… ok. that makes sense to me now, hope my server admin understands that. Thanks for responding!

        • Jeevanandam M.

          You’re welcome!


  • David Rose

    all fixed, seems that the super-cache had an issue

    • Jeevanandam M.

      @disqus_B9CcNve5uD:disqus – good to hear, its working!

  • Christoph

    Finally a solution which is simple and just works! Many thanks, this was exactly what I was looking for!