fix url generation if secure is false in a secure page