Setting up Additional Sites


Perhaps you have a Website at www.example.com. You'd like to offer a blog for your business, but also another blog for your hobby, and you don't want the two mixed in together.

WordPress makes it easy to run more than one blog from one database by using different table prefixes. This would make it possible for you to have your business blog at www.example.com and your hobby blog at www.example.com/hobby. And if you were a real blog enthusiast you could just as easily have more blogs at www.example.com/family, www.example.com/friends, and so on.

To achieve this you create multiple directories containing the WordPress files on your serverone for each blog. The wp-config file in each directory uses a different table prefix. WordPress then stores the posts, links and all other content and configuration options for each blog in its own set of tables within the one database.

Tip

  • Another way to do this is to set up a separate MySQL database for each blog. This is how Maria manages multiple WordPress blogs on her server.


To set up additional sites

1.

Use your FTP client or server Control Panel to create a separate directory for each blog (Figure 62) and upload the WordPress files into each directory.

Figure 62. At MacTips.info Miraz runs three separate blogs from one database. The blogs are in separate directories: blog, learn, and tips. There are some other, unrelated, directories and files on the site too.


2.

Use the instructions below to edit the wp-config file for each blog to use a separate table prefix.

3.

Complete the installation for each blog. WordPress creates separate sets of tables for each blog (Figure 63). Each blog operates independently of the others.

Figure 63. This database contains two separate sets of tables for two separate blogs. One blog uses the prefix vqs200406_ while the other uses the standard wp_.


Tip

  • Chapter 1 shows how to install WordPress.


To edit wp-config

1.

For each blog decide on a unique table prefix, for example: work_, hobby_, family_, friends_.

2.

Open each wp-config file in turn. Locate the line that says $table_prefix = 'wp_'; and replace wp_ with the table prefix you have selected for that blog (Figure 64).

Figure 64. For my test blog's wp-config file I've chosen the table prefix of vqs200406_.


3.

Save each wp-config file in the directory for the blog it belongs to. When you complete the install, WordPress creates separate sets of tables for each blog within the one database. Each blog operates independently of the others.

Tip

  • Chapter 1 explains how to create and set up a wp-config file.





WordPress 2. Visual QuickStart Guide
WordPress 2
ISBN: 0321450191
EAN: 2147483647
Year: 2004
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net