Hi Mark,
I am afraid this don't work for my config.
This is because when using https my domain name is site1379293681.websiteseguro.com, but when using http my domain name is different - site1379293681.hospedagemdesites.ws.
I think you should use a var like $URL_HTTP as I have suggested.
In my config
$URL is
https://site1379293681.websiteseguro.com/Site/wordpress/wp-admin
$URL_HTTP is
http://site1379293681.hospedagemdesites.ws/Site/wordpress/wp-admin
Thanks,
Miguel