I can only assume you aren't hard coding the URL, as you seem to have managed to handle things properly.
Are you caching the page with some WP-Supercache or other shit? If you have /any/ form of caching on this, it's not going to re-execute depending on how you are calling it.
|