Solved it. Had to do with it being a subdirectory install.
My setup was something like this:
WordPress address (URL): mydomain.com/blog
Site address (URL) issue: http://www.mydomain.com
The ‘/blog’ part was not the issue. The fact that there were differences in the domain name (‘www’) completely threw the referer, I think.
Written this way, it works fine.
WordPress address (URL): http://www.mydomain.com/blog
Site address (URL) issue: http://www.mydomain.com