Azure / Azure/static-web-apps

`href="./"` does not work

Open
#683 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**

Deploying an HTML file with a relative link in it leads to 404, and does not display the expected page. However, when serving the site locally it works.

**To Reproduce**
Steps to reproduce the behavior:
1. Deploy `/example/helloworld/index.html` file
2. Deploy `/example/index.html` which contains a `Click` link
3. Navigate to `https://my-static-website-url/example/`
4. Click the link displayed
5. Result is a 404 error, as browser gets redirected to `/helloworld` instead of `/example/helloworld/`

**Expected behavior**
Content of `example/helloworld/index.html` is displayed

**Device info (if applicable):**
- OS: MacOS
- Browser: I tried Chrome, Safari and Firefox
- Version: latest

**Additional context**
When serving the same website locally (e.g. via Nginx, hugo or apache) same code works as expected.

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.