Support appending .html to URLs

Open
#615 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
backend

Research direction

Start by tracing the existing URL lookup that resolves folders to index.html, then identify where extensionless paths and the additional header-matching and pre-compressed-asset rules are handled. The work is done when an option resolves /page to /page.html while preserving those lookup rules across all build targets.

Written by the indexing model from the issue text.

Description

enhancement help wanted v2
Search for duplicate feature request
  • I already searched, and this feature request or improvement is not a duplicate.
Feature scope

Improve existing functionality

Feature request related to a problem

I know the SWS has a mode where you can have folders with index.html and then e.g. /page would look up /page/index.html. Another very common output (in particular with modern frameworks would be /page to serve /page.html. Would be great if this would be an option as well.

Describe the solution you'd like

Enable a mode where it can check if a a URL without extension can be resolved to a html file by appending .html (and obviously applying all the additional lookup rules like header matching as well as serving pre-compressed assets).

Describe alternatives you've considered

The alternative is configuring the tools to output index.html files within folders of the page and turning of the auto appending trailing slash.

Build target

All targets

Additional context

E.g. SvelteKit static page uses the page.html output by default. And it seem to be the default for a lot of frameworks. So it would make SWS a super easy drop in solution to serve this kind of static pages.

Dominant language
Rust
Stars
2.4k
Forks
130
Avg merge
3d 4h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from static-web-server/static-web-server

All issues in static-web-server/static-web-server

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.