Piotrek
Piotrek

Reputation: 1416

Azure CDN - How to redirect from root domain to www? Some rules from Rules engine don't apply

I created a static page using Azure Storage and CDN with Microsoft Standard pricing tier. I need to redirect user from example.com to https://www.example.com (with www), but my rules doesn't seem to work - only http to https redirection rule works so when I type example.com I'm redirected to https://example.com

That's my rules configuration:

enter image description here

That's domain records: enter image description here

Both options are added in custom domains for this cdn: enter image description here

Upvotes: 9

Views: 6167

Answers (2)

user160357
user160357

Reputation: 1506

Goal

Redirect root/apex domain to WWW subdomain, using Azure CDN without buying/making your own cert.

Can this be done?

Yes

How?

Use below config, remember to use Moved 301, not "Permanent Redirect 308"

enter image description here

Upvotes: -2

Piotrek
Piotrek

Reputation: 1416

The problem is that at first user is forwarded to https://example.com where there is no cert and privacy error appears and rules are not applied. Rules could be changed to this:

enter image description here

so now user is forwarded from example.com to https://www.example.com, but if somebody will type https://example.com he will still see an error. Solution to this could be buy SSL cert, because Azure CDN doesn't allow CDN Managed SSL for apex domain.

Upvotes: 8

Related Questions