static-web-server
static-web-server copied to clipboard
Redirects and rewrites are basically the same thing
Search for duplicate feature request
- [X] 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