Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing a WordPress site on my Mac, running OS X 10.6.4. I'm using OS X's built-in Apache server to run the site locally during development. I've set up WordPress and connected it to OS X's MySQL with no problems. The site seems to work fine, and I can post, edit, etc.

The WordPress installation is in a folder called ~/Sites/

I've also customized my .hosts file and Apache's httpd-vhosts.conf file, to redirect requests for to this folder. So when I enter in a browser window, the site loads. No problems here.

So I can access the site, in a browser, from two different addresses,, and http://localhost/~Gabe/

Here's what's weird: When I go to, the WordPress site loads normally. When I go to http://localhost/~Gabe/, WordPress can't find any posts from the database: It gives me the "Sorry, no posts met your criteria" message (which is built into the theme for when a search for posts returns nothing). N.B.: Apache processes the PHP code normally in both cases -- but in one case WordPress can get posts from MySQL, and in the other case it can't.

My first thought was that this was a problem with WordPress's configuration, so I changed the WordPress URL to http://localhost/~Gabe/, but this made no difference.

I don't understand why using the two addresses produces different results. Any help appreciated.

(Here's why I care, in case you're wondering: I want to preview the site in BBEdit's web preview window, and BBEdit will only load the site via the http://localhost/~Gabe/ address.)

share|improve this question

I was able to solve this problem—it turns out that WordPress behaves better when I set both the WordPress address and the site address to http://localhost/~Gabe/

share|improve this answer

This is not a problem with OS X or Apache. A redirect doesn't change any PHP code behavior and since you apparently get response from the code, nothing is wrong with the server setup. The problem lies in the way Wordpress reads the domain name from the request (which is the only thing that should differ) and what it does with it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.