Joomla!, Wordpress tips for building your site

How to control Multi domain with One Wordpress

Published on| January 28th, 2010 | 3 Comments.

If you want to control Multi domain with one WordPress, you might think that you install WordPress MU to your server. But if your server is rental server, you might not install WordPress MU.
So, this post will give a description of one idea without WordPress MU.

See : “Multiple domains using one WP install (not wpmu)

Let’s edit ‘wp-config.php’

You will find ‘wp-config.php’ file in directory where WordPress was installed. You should open it with text editor.
Next step, you will search ‘$table_prefix’ in it, and you will find keyword it.
Perhaps, if you did not change database suffix when you have installed WordPress, you will see the same codes as the following codes.

Previous edit

$table_prefix = 'wp_';

* if you changed database suffix when you have installed WordPress, ‘wp_’ characters was the different characters.

You should edit ‘wp-config.php’ as following codes.

After edit

$table_prefix = '';
$domain = strtolower($_SERVER['HTTP_HOST']);
switch ($domain) {
case "blog111.example.com":
	$table_prefix  = 'wp_';
	break;
case "blog222.example.com":
	$table_prefix  = 'wp_222_';
	break;
}

With this example, already installed domain name is “blog111.example.com”.
Also new domain is “blog222.example.com”.

Let’s set root path with new domain

With this example, you should set root path of already installed domain to root path of new domain .

Let’s access new domain

With this example, you should access ‘blog222.example.com’ with web browser .
You will see install page of WordPress.

Notes

This way is very simple, and you will avoid that many WordPress will be installed. So , and you can share resources of plugin or theme in one WordPress.

But you must note that you should update database when you update WordPress. Because each table of the data base is different in each domain.

Also you must note whether necessary plugins execute correct. Because the plugin might use the database.






Comments

3 Responses to “How to control Multi domain with One WordPress”

  1. サーバー運用メモ « Advernya's Memo Blog
    May 23rd, 2010 @ 01:14:06

    […] […]

  2. XREAにwordpressを複数設置し楽したいのだった【追記していきます】 – みついれ@カオス
    June 6th, 2010 @ 15:38:23

    […] […]

  3. XREAにwordpressを複数設置し楽したいのだった – みついれ@うぇぶろぐ
    September 28th, 2010 @ 13:30:31

    […] […]

Leave a Reply








Transrator

Recent Posts

Categories

Tag Cloud

execute remove フロントページ 投稿ページ トップページ install WIndows Note Convert META generator 日付 donwload file manage multibyte utf-8 unicode shiftjis euc console サイトマップ 問題 ParmaLink Redirect パーマリンク はみ出る pre テンプレート テーマ タグクラウド マルチランゲージ リダイレクト PHP(タグ) タグ table control HTML(タグ) コマンド 国際化(翻訳) SQLite(タグ) MySQL(タグ) qTranslate プラグイン(タグ) Wordpress(タグ)

Links

Site Description

Joomla!, Wordpress as CMS using a site building, site management, software usage to describe the development tips.

  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ