Exact same problem for me. I’ve entered the CDN url (an AWS Cloudfront one) and it rewrites the URLS but appends the original site name in front of the rewritten URL.
i.e.
https://www.sitename.com is my sitename
cdn.sitename.com is my cdn
when CDN is enabled I get rewritten URLS of https://www.sitename.com/cdn.sitename.com/page
I thought perhaps this might be a problem with .htaccess but don’t know what to look for.