Consider the `useSSL` flag of the root page when generating URLs (see #7390)