Redirects and rewrites are basically the same thing

Open
#363 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
backend, web-dev

Research direction

Start by locating the existing redirect and rewrite configuration, data structures, and implementation paths, then compare how host matching and internal redirects are handled. Done means redirects can be represented through rewrites with an optional host, existing redirect configuration remains backwards-compatible, and behavior is covered across all targets.

Written by the indexing model from the issue text.

Description

enhancement help wanted v3
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

Initially I didn’t recognize the difference between redirects and rewrites, and they are in fact almost identical. It seems that there are only two differences: redirects can be tied to a host name whereas as rewrites cannot, and rewrites support internal redirects whereas redirects don’t. It shouldn’t be too hard to merge both features and remove the confusion.

Describe the solution you'd like

Adding an optional host field to rewrites will be backwards-compatible and render redirects superfluous. The redirects configuration options can stay for backwards compatibility but be rendered into Rewrites data structure. This will get rid of the confusion around these features and code duplication.

Describe alternatives you've considered

Things can stay as they are now of course. Internal redirects will have to affect all hosts then.

Build target

All targets

Additional context

No response

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.