Skip to content

Incorrect URLs generated in directory listing page for nested folders when filenames are numeric #168

@nitin2953

Description

@nitin2953

Five Server’s built-in directory listing page generates incorrect anchor URLs when browsing a nested directory that contains files with numeric-only names (e.g. 1.html, 2.html).
This issue does not occur at the root (http://localhost:5500/), only inside subdirectories.

Steps to Reproduce

  1. Create the following structure:

    root/
      1.html
      2.html
      3.html
      TODO.md
      test/
        1.html
        2.html
        3.html
        TODO.md
    
  2. Start Five Server & go to http://localhost:5500/.

  3. Open http://localhost:5500/test/.

  4. Click links in the auto-generated directory listing.

Actual Result
Links in the listing are incorrect:

1.html   => //test/1.html/
TODO.md => //test/TODO.md/.preview

Expected Result
Links should resolve correctly, for example:

/test/1.html OR http://localhost:5500/test/1.html
/test/TODO.md.preview OR http://localhost:5500/test/TODO.md.preview

Notes

  • Root directory listing (http://localhost:5500/) generates correct URLs.
  • The issue appears related to path resolution in nested directories, especially with numeric filenames.
  • No physical index.html exists; this is Five Server’s virtual directory listing page.

Environment

  • OS: Windows
  • VS Code: latest
  • Five Server: latest
  • Browser: Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions