Monthly archives: August 2010

WordPress 3.0: Subdomains in Bluehost

Many people, including me have troubles using a multisite feature of the recently released WordPress 3.0. I wanted to merge all my sites and to use subdomains (directories) for the address of each site (e.g. my.blog.com instead of blog.com/my). In order to create subdomains, WordPress requires us to create a wildcard subdomain. However, wildcard subdomains are not supported on Bluehost, where my site is currently hosted at. So, after searching for information on the net, I found that there are two workarounds that we can do in order to get our WordPress 3.0 multisite working:

Option 1

Subdomain Option 1
Create a subdomain on Bluehost’s CPanel, and point the document root to /public_html/. Then create a new site on WordPress with the same subdomain name as the one you create on the CPanel. Simple!

Option 2

Subdomain Option 2
Create a wildcard subdomain (*) on Bluehost’s CPanel, and point the document root to /public_html/. Some people reported that this indeed worked! By creating this wildcard domain, you are allowed to use any domain names you like (visitors can still type in any random subdomains and they will still end up in your main site! Awesome, huh?). But one thing to be aware of is that, you need to set up redirects through ModRewrite or scripting if you don’t want some subdomains to link to your WordPress files.

I personally prefer the first option (and I have tested this, and it works!), since I only use this website for myself and I don’t add new sites on WordPress very often. Well, it’s up to you :)

Character Encoding Problems

After performing an upgrade to an earlier version of WordPress, I saw some weird characters (e.g. “ for “”) shown on my posts. It turned out that many people had the same problem as mine. So, if you encounter some character encoding problems which prevent WordPress from showing “normal” characters, there are some fixes that you can try:

Changing Config Files

One thing you can do is to change the wp-config.php file by adding or replacing these codes:

define('DB_CHARSET','');
define('DB_COLLATE', '');

It worked for me only once. When the next time I did an upgrade and the problem occurred again, it didn’t work anymore. So I tried the next fix.

Executing SQL codes

This fix is for advance users only who are quite familiar with the SQL codes. Please backup your database first before proceeding! :) Once you’ve done that, execute these SQL codes:

UPDATE wp_posts SET post_content = REPLACE (post_content, '–', '---')
UPDATE wp_posts SET post_content = REPLACE (post_content, '’', ''')
UPDATE wp_posts SET post_content = REPLACE (post_content, '“', '"')
UPDATE wp_posts SET post_content = REPLACE (post_content, '”', '"')

What these codes do is to replace the strange characters in your post content into the ones that are readable by WordPress. The codes use wp_posts table, so make sure you change these table names if you use different table names for your WordPress blog.

Hope it works!