1

We use Cloudflare, and Sendgrid for email.

Via Sendgrid setup, we have added a DNS record:

enter image description here

However, this redirects to our main domain:
Example link.construct.net generated by SendGrid

If I disable CloudFlare routing (the orange cloud), the URL creates a security exception because HSTS is enabled for construct.net and all subdomains.

Am I correct in assuming link.construct.net should not end up on construct.net, and how can I resolve this so that the links resolve correctly?

1

I believe that you are incorrect. An HTTP request to link.construct.net should redirect to construct.net.

Things are working the way they are supposed to work. With cloudflare enabled on your link subdomain, the DNS entries for it point to cloudflare. Cloudflare handles HTTPS termination like this. Cloudflare reverse proxies the request to sendgrid. Sendgrid sends a HTTP 302 temporary redirect to your main site with tracking parameters on the URL.

The redirect to your live site is only for tracking. The click hits sendgrids servers so that they know about it. They also use append utm tracking parameters onto the URL for your benefit in Google Analytics.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.