Commit 8fd1dd0
authored
feat: redirect www.essentialcsharp.com to apex domain (#1109)
## Problem
\www.essentialcsharp.com\ currently returns a 404 (HTTP) or connection
reset (HTTPS) because the Azure Container App doesn't handle the \www\
hostname.
## Solution
Adds a **301 permanent redirect** in the production middleware pipeline
that strips the \www.\ prefix and redirects to the apex domain
(\�ssentialcsharp.com\).
### Key details
- **Production only** — inside the \!IsDevelopment()\ block, local dev
is unaffected
- **After \UseForwardedHeaders\** — so the real \Host\ header is
readable behind the ACA ingress proxy
- No new dependencies
## Required Azure change (separate)
\www.essentialcsharp.com\ must be bound as a custom domain on the Azure
Container App so traffic reaches the app at all (Azure will also
provision a managed TLS cert).1 parent 73868a6 commit 8fd1dd0
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
446 | 457 | | |
447 | 458 | | |
448 | 459 | | |
| |||
506 | 517 | | |
507 | 518 | | |
508 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
509 | 533 | | |
510 | 534 | | |
511 | 535 | | |
| |||
0 commit comments