WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. 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/mysite.dev.

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

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

Here's what's weird: When I go to http://mysite.dev, the WordPress site loads normally. When I go to http://localhost/~Gabe/mysite.dev/, 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/mysite.dev/, 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/mysite.dev/ address.)

share|improve this question
Can you post your .hosts and httpd-vhosts.conf files? – MikeSchinkel Aug 22 '10 at 8:22
up vote 1 down vote accepted

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/mysite.dev/.

share|improve this answer
Yeah, keep in mind that wordpress is totally bound to the URL of the site. It's some restriction that sucks with wordpress totally, so better understand that you bind your blog with the URL you enter in your browser than anything else. That's the same when you stage your development site to a server in the internet with a new toplevel domain name. You need to change everything in the database that referenced to the old site URL. – hakre Aug 27 '10 at 22:19
P.S. please mark your own answer as answer. – hakre Aug 27 '10 at 22:19

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.