Multiple domains for multiple single installs

The question:

I’ve done my share of searching, but apparently my search-fu is failing me, because I haven’t found anything that really seems to fit my circumstance. Also, I don’t want to just try random solutions and end up bricking everything.

I have a client who has previously managed her site and installations herself and has now hired me on to take things over.

Currently there is one hosting account with two domains.

The host is GoDaddy. It’s a Deluxe linux account.

  • There is a WordPress installation in the root directory of the account, currently serving
  • There is a second WordPress installation in a directory ( This install is suppose to be serving Which it does, but it’s also posing a bunch of problems.

Under the installation for ( installed in ), I can’t change the permalink settings to anything but default with out breaking the entire site.

  • Changing the permalink settings results in the warning that WordPress can’t write to .htaccess. Despite the .htaccess permissions being set to 644 (I even tried 777).
  • So I manually edited the .htaccess file to WordPress’s generated content.
  • This results in the site ‘breaking’. The front page shows some default content that I don’t recognize and none of the links result in pages being loaded. Just the default ‘page not found’.

Under the General settings the install is set to:

WordPress Address (URL) :
Site Address (URL) :

IS it possible to successfully run two separate domains from two separate WordPress installs, under the same hosting account, with out switching everything over to a network?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

Serve both sites from the same installation.

In your wp-config.php include the settings depending on $_SERVER['HTTP_HOST'].

Example for a complete wp-config.php:

define( 'DB_HOST',     'localhost' );
define( 'DB_CHARSET',  'utf8' );
define( 'DB_COLLATE',  'utf8_general_ci' );

if ( '' === $_SERVER['HTTP_HOST'] ) // .net domain
    include '';
elseif ( '' === $_SERVER['HTTP_HOST'] ) // .com domain
    include '';
    die( 'something went wrong' ); // improve this error message

defined( 'ABSPATH' ) || define( 'ABSPATH', dirname( __FILE__ ) . '/' );

The .htaccess rewrite rules for single site installations are always the same, so don’t worry about conflicts.

If there are some identical settings in and you can move these to the main file, the authentication keys and salts for example or basic DB constants.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment