Replacing rel=canonical with a CloudFront Function
0
I'm proxying my Adobe Portfolio to Cloudflare via CloudFront in the middle, as Portfolio does not allow CNAME and "orange cloud" proxying. It works just fine, but there is one thing that I want to change as the content leaves CloudFront: the rel=canonical line in the html head section. Right now it's the url of my Portfolio, which is not good for SEO, and I want to replace it with my own root domain from where it is supposed to be served to the internet.
I already have the Security Headers function added, as advised by the example code in the Functions doc. I would like to add the rel=canonical replacement Function to that if possible, but fine if it's a separate one.
Thanks in advance.
PS: I'm not a big project user, so it's a personal web presence only.