Membuat multi website menggunakan subdomain dan cms wordpress

By | October 22, 2018

Ada beberapa kelebihan membuat multi website melalui subdomain, diantaranya adalah :

1. Google sebagai search engine utama, memberlakukan subdomain berdiri sendiri sebagai entitas berbeda, sehingga sebuah situs dengan subdomain merupakan bangunan tersendiri dan mandiri.
2. Dengan subdomain, ini akan bisa meningkatkan perankingan domain utama, ataupun sebaliknya, melalui domain utama yang telah cukup dikenal, dengan sendirinya subdomain akan mudah dalam meraih perankingan di mesin pencari.
3. Dengan diberlakukannya subdomain sebagai entitas tersendiri, maka membangun out dan in bound link bisa dilakukan dengan mudah oleh pemilik domain.
4. Dengan subdomain, berarti kita tidak perlu mendaftarkan domain baru atau cukup menambahkan pada domain utama yang telah dimiliki. Ini tentunya akan menghemat biaya. Bahkan saat ini, sebuah domain utama diberi kebebasan untuk membuat 1000 sub domain.

Ada beberapa pertimbangan menggunakan wordpress sebagai multi site, diantaranya :

1. Disamping populer juga dikenal sebagai cms yang cukup ringan dan sederhana.
2. Dengan hanya memakai sebuah engine wordpress, berarti juga menghemat storage pada hosting.
3. Untuk keperluan aksesories seperti theme dan plugin, cukup sekali upload pada tempat yang sama, dan bisa digunakan secara sharing untuk setiap domain.
4. Untuk proses upgrade kita hanya sekali mengupload file-file yang dibutuhkan. Setelah itu proses instalasi upgrade bisa dilakukan untuk setiap subdomain.

Untuk memasang wordpress sebagai multi site ke banyak subdomain yang dibutuhkan hanyalah merubah file wp-config.php menjadi seperti berikut :

< ?php // ** MySQL settings ** // if ($_SERVER['HTTP_HOST']=="DomainAnda.com") { define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_USER', 'usernamehere'); // Your MySQL username define('DB_PASSWORD', 'yourpasswordhere'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique phrase. You won't have to remember the phrases later, // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // to get keys generated for you, or just make something up. Each key should have a different phrase. define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'wp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-content/languages. // For example, install de.mo to wp-content/languages and set WPLANG to 'de' // to enable German language support. define ('WPLANG', ''); } elseif ($_SERVER['HTTP_HOST']=="subdomain.DomainAnda.com") { define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_USER', 'usernamehere'); // Your MySQL username define('DB_PASSWORD', 'yourpasswordhere'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique phrase. You won't have to remember the phrases later, // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // to get keys generated for you, or just make something up. Each key should have a different phrase. define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'wp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-content/languages. // For example, install de.mo to wp-content/languages and set WPLANG to 'de' // to enable German language support. define ('WPLANG', ''); } else { define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_USER', 'usernamehere'); // Your MySQL username define('DB_PASSWORD', 'yourpasswordhere'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique phrase. You won't have to remember the phrases later, // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // to get keys generated for you, or just make something up. Each key should have a different phrase. define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'wp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-content/languages. // For example, install de.mo to wp-content/languages and set WPLANG to 'de' // to enable German language support. define ('WPLANG', ''); } /* That's all, stop editing! Happy blogging. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); require_once(ABSPATH . 'wp-settings.php'); ?>

Bagi yang memiliki keterbatasan akses untuk database, bisa juga menggunakan hanya sebuah database yang di pakai bersama-sama untuk semua subdomain dengan cara menentukan table_prefix secara khusus, misalnya $table_prefix = ’sub1wp_’; untuk subdomain 1
$table_prefix = ’sub2wp_’; untuk subdomain2 dan seterusnya.

langkahnya simpel aja kok, tinggal replace wp-config.php yang ada dengan wp-config.php yang dah dimodif.

yang perlu diperhatikan hanya nama domain/sub domain sama table prefix-nya aja. sebagai gambaran saya repost wp-gonfig.php yang saya kasih tebal disesuaikan dengan nama domain atau sub domain yang dipakai.

< ?php // ** MySQL settings ** // if ($_SERVER['HTTP_HOST']=="DomainAnda.com") { define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_USER', 'usernamehere'); // Your MySQL username define('DB_PASSWORD', 'yourpasswordhere'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique phrase. You won't have to remember the phrases later, // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // to get keys generated for you, or just make something up. Each key should have a different phrase. define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'mainwp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-content/languages. // For example, install de.mo to wp-content/languages and set WPLANG to 'de' // to enable German language support. define ('WPLANG', ''); } elseif ($_SERVER['HTTP_HOST']=="subdomain1.DomainAnda.com") { define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_USER', 'usernamehere'); // Your MySQL username define('DB_PASSWORD', 'yourpasswordhere'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique phrase. You won't have to remember the phrases later, // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // to get keys generated for you, or just make something up. Each key should have a different phrase. define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'sub1wp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-content/languages. // For example, install de.mo to wp-content/languages and set WPLANG to 'de' // to enable German language support. define ('WPLANG', ''); } elseif ($_SERVER['HTTP_HOST']=="subdomain2.DomainAnda.com") { define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_USER', 'usernamehere'); // Your MySQL username define('DB_PASSWORD', 'yourpasswordhere'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique phrase. You won't have to remember the phrases later, // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // to get keys generated for you, or just make something up. Each key should have a different phrase. define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'sub2wp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-content/languages. // For example, install de.mo to wp-content/languages and set WPLANG to 'de' // to enable German language support. define ('WPLANG', ''); } else { define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_USER', 'usernamehere'); // Your MySQL username define('DB_PASSWORD', 'yourpasswordhere'); // ...and password define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); // Change each KEY to a different unique phrase. You won't have to remember the phrases later, // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ // to get keys generated for you, or just make something up. Each key should have a different phrase. define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'wp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-content/languages. // For example, install de.mo to wp-content/languages and set WPLANG to 'de' // to enable German language support. define ('WPLANG', ''); } /* That's all, stop editing! Happy blogging. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); require_once(ABSPATH . 'wp-settings.php'); ?>

semoga bermanfaat, jika anda sudah punya pengalaman yang lebih perihal ini, silahkan diskusikan disini.

25 thoughts on “Membuat multi website menggunakan subdomain dan cms wordpress

  1. guna

    “Untuk memasang wordpress sebagai multi site ke banyak subdomain yang dibutuhkan hanyalah merubah file wp-config.php menjadi seperti berikut :”

    setelah setting wp-config.php lalu bagaimana? saya mau instal ke subdomain gimana caranya spy s ngelink?

  2. Alphonso Fial

    Adwords is really good in driving traffic to your website. however, they are very strict right now and they would not easily approve websites that they thought have low quality content. |

  3. Ivan Syba

    Nah masih bingung banget sama wp-config multi site ini.

    Apakah kita buat subdomain secara manual. kalau WordPress MU kan bisa langsung daftar dari domain utama

    cara setting $table_prefix :
    table_prefix secara khusus, misalnya $table_prefix = ’sub1wp_’; untuk subdomain 1
    $table_prefix = ’sub2wp_’; untuk subdomain2 dan seterusnya.

    Apakah tabel diatas digunakan setalah kita membuat subdomain di cpanel dulu.

    Saya telah coba mereplace wp-config di blog saya tapi kok malah blog error dan hanya menampilkan deretan kode di wp-config.php apa ada yang salah.

  4. blogoholic.web.id

    kalau saya buat subdomain terus di host di blogspot, biar nambah ilmunya gak cuma bisa di wordpress tapi juga di blogspot. kalau buat subdomain di satu hasting saya gak kebayang butuh berapa space dan bandwidthnya secara saya ini masih mahasiswa yang belum punya penghasilan tetap, coz biaya sewa hosting dan domain harus nabung.

    1. Farraha.Net Post author

      blogoholic.web.id :

      bisa di akali kok, anda beli saja hosting yang murah, kemudian buat subdomain nya di DNZ zone setting nya,

      maksud nya, anda buat blog di blogspot sebanyak banyaknya, kemudian anda pakai domain asli dengan cara membuat subdomain di dns zone nya, maka anda hanya perlu satu domain dan hosting saja, tapi anda bisa memiliki website sebanyak yang anda mau, oke??

      semoga penjelasan ini membantu.

  5. esha

    Mau berbagi informasi…
    Buat yang aktif nge-blog dan ingin berbagi informasi tentang peristiwa di seputar Anda. Portal Berita Jurnalisme Publik | EKSPOSRAKYAT.com mengundang Anda untuk menjadi Kontributor.
    Bagi yang aktif bisa direkrut menjadi wartawan tetap. Silahkan mendaftar menjadi Kontributor di EKSPOSRAKYAT.com

  6. dimas irawan

    mas, misal gini, aku mau buat subdomain buat mobile m.example.com lalu aku buat cms baru di subdomain itu. Apa harus menggunakan database yang sama dengan yang di example.com. Apa trik di atas bisa?

  7. Susan Blackberry Z10

    Mas, WP MU apakah juga bisa dibuat seperti web portal besar macam detik, viva, kompas, dsb.
    Untuk per kategori, mereka menempatkan pada subdomain sendiri-sendiri.
    Pada saat suatu kategori mendapat update postingan, maka akan muncul tampilan di home page.
    Nah, kalau membuat kategori yang tampil di home page itu, bagaimana caranya ya?

    Terima kasih sebelumnya.

Leave a Reply