Your friendly neighbourhood geek

How do I make WordPress permalinks work on nested domains?

GoDaddy’s Deluxe hosting allows for multiple websites all under one account. The way they do this is by pointing the domains to subfolders within the root. But, this poses a problem when trying to activate the permalink structures for these new sites since the 404 handling is pointing to the main root folder instead of your domain’s root folder. I’m searching for a way to rectify this issue since I have quite a few clients in this situation. Any ideas?

I got this question from Rene who left it as a comment on a question about making permalinks word on GoDaddy. I’ve read a bit about the subject and there are two things you need to check.

The first relates to the fact that Apache uses a file called .htaccess to control thinks like search-engine friendly permalinks. This file redirects request all URLs that don’t have a file associated with them to the main WordPress file and then WordPress can figure out which page to display.

Now .. the one thing you need to realise about .htaccess is that if Apache doesn’t find out, it will try the parent directory for the file and work it’s way up the tree until it finds a file. So, the first thing to check is that you do have a file called .htaccess in the root folder of your new blog to ensure it’s trapping requests.

The other thing to check is your wp-config file. I found a blog post from someone who had a similar problem which suggests that the configuration file for the 2nd blog he created wasn’t working properly and ended up pointing at a different blog. This resulted in his URLs pointing at the parent blog and pages being redirected to the wrong place.

Unfortunately you’re going to have to try and debug this one, but I’m happy enough to give you a hand and update this article with whatever we find. It’s not as simple as clipping on a pulse oximeter to see if your blood oxygen levels are low, but I’m sure we can get to the bottom of it in the end.

Also, typing in an incorrect URL on the secondary domain points me to WordPress’ 404 page on the secondary domain, not the first domain.

Btw, if it is a fresh install of WordPress and your htaccess file is new, then it might take an hour or so before the server cache is updated and it to recognize the htaccess file. Once done once, changes can be made to the htaccess file with immediate results. It might explain why you are seeing your primary domains 404 page rather than the secondary domains.