Fix #1039 

This fixes the invalid ATOM feeds generated when SITEURL
contains https or a subdirectory.

This applies to both, 3.2 series and master.