Azure / Azure/static-web-apps

staticwebapp.config.json -> routes redirect does not support fully qualified URLs

Open
#1,120 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Redirects with full URLs do not trigger redirects. Consider:

```json
{
"routes": [
{
"route": "https://blog.johnnyreilly.com/",
"redirect": "https://johnnyreilly.com/",
"statusCode": 301
}
],
}
```

This does not trigger a redirect from https://blog.johnnyreilly.com to https://johnnyreilly.com

https://github.com/johnnyreilly/blog.johnnyreilly.com/blob/3cd71d0b968b21ed82c8b248ef78993da2632783/blog-website/staticwebapp.config.json#L10-L14

Go to https://blog.johnnyreilly.com and you'll see it in action!

**Expected behavior**
A redirect

**Screenshots**
![image](https://user-images.githubusercontent.com/1010525/226706868-984e00b1-6009-4d36-a87c-c64cdaeaf32c.png)

**Device info (if applicable):**
N/A

**Additional context**
https://github.com/johnnyreilly/blog.johnnyreilly.com/pull/477

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.