Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly implement Redirect feature #8

Open
8 of 10 tasks
8eecf0d2 opened this issue Oct 17, 2018 · 0 comments
Open
8 of 10 tasks

Correctly implement Redirect feature #8

8eecf0d2 opened this issue Oct 17, 2018 · 0 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@8eecf0d2
Copy link
Owner

8eecf0d2 commented Oct 17, 2018

This is a pretty insane feature considering what it's called, what it's actually capable of, and how it's implemented...

Notice: It's confusing and important to understand if the "redirect rule" in question is a true 3xx style redirect or a more fancy rewrite.

The main features to implement:

  • Traditional Redirect
  • Traditional Rewrite (to filesystem / build.publish)
  • Proxy Rewrite
  • Placeholder / Pattern matching

Redirect Features

Basic Redirects / Rewrites, Http Status Codes

Netlify will return status code 301 for what it calls basic redirects.
Netlify will perform a rewrite if a status code is set and not equal to 301, 302, 303.

  • Support "basic redirect"
  • Support "basic rewrite"

Custom 404

By default Netlify will serve a 404.html file if it's provided and no redirect rules or static files match the path.

  • Support for custom 404.html

Trailing Slashes

I'm not even gonna bother with this yet...

Placeholders

Basically param swapping between from and to - should be easy enough to implement with express and a url pattern library.

from = "/:partA/:partB"
to = "/:partB/:partA"
# "/foo/bar" → "/bar/foo"
  • Support placeholder / pattern replacement

Splats 🤦‍♀️

Similar to placeholders except the * and :splat param are bound.

  • Support special splat placeholder

Query Params

More or less states that query params can be used as placeholders, the syntax is weird but toml is luckily more readable that Netlify's _redirect file formatting.

  • Support query placeholder

Hostnames & Protocols, GeoIP & Language

These feature are getting way beyond my personal use cases - plus I don't see them being entirely useful for local development, it'd be great to support them but I'm not holding my breath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant