- Joined
- Apr 19, 2021
- Messages
- 21
- Likes
- 9
- Degree
- 0
Hi builders,
i'm new here and want to share a snippet i use since a long time to run several websites in one WP folder.
When you open up wp-config.php you will find a line like:
changing that to:
and pointing several different blogs to that wp folder will give you multiple blogs without the hassle of using WP Multisite or what it is called.
i'm new here and want to share a snippet i use since a long time to run several websites in one WP folder.
When you open up wp-config.php you will find a line like:
PHP:
$table_prefix = 'wp_';
changing that to:
PHP:
//$table_prefix = 'wp_';
$table_prefix = preg_replace('/^(www\.)/', '', $_SERVER['HTTP_HOST']);
$table_prefix = preg_replace('/\-/','', $table_prefix);
$table_prefix = preg_replace('/\./','', $table_prefix);
$table_prefix = $table_prefix . '_';
and pointing several different blogs to that wp folder will give you multiple blogs without the hassle of using WP Multisite or what it is called.