Skip to content

Hosting environments that add a trailing back slash break page links #2394

@littlespex

Description

@littlespex

🐛 Bug Report

Hosting setups that add a trailing back slash to urls break all inter-site links on the page.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Create a new site using npx @docusaurus/init@next init test-site classic
  2. Create two new sub folders in docs called a and b
  3. Add attached file a.md to a folder, and b.md to b folder.
  4. Replace sidebar.js with attached version.
  5. run npm run build to generate the flat site.
  6. Load the site in any browser by navigating directly to the url of page a: http://127.0.0.1:8080/docs/a/a
  7. Click the link Link to page "b"

Expected behavior

Page b should load.

Actual Behavior

Page Not Found page.

Your Environment

  • Docusaurus version used: 2.0.0-alpha.48
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Safari 13.0.5 (15608.5.11), Chrome 80.0.3987.132, Firefox 73.0.1
  • Operating system and version (desktop or mobile): macOS 10.15.3 (19D76)

Reproducible Demo

(Paste the link to an example repo, including a siteConfig.js, and exact instructions to reproduce the issue.)

http://littlespex.com/docusaurus/docs/a/a

test-site.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiondomain: trailing slashRelated to trailing slash config

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions