Experimental toolkit for working with _redirects file.
redirects-parserSimple parser for_redirectsfilesredirects-ktorRedirection plugin with support for_redirectsfiles for KtorservineLocal HTTP server with support for_redirectsfiles
CAUTION: All libraries are published on GitLab, despite a "Packages" section being present on this repository.
⚡ This app and its libraries are under heavy development and are not stable yet. Moreover, they should only be used for development purposes only - very little sanity checks are performed.
The redirection implementation is largely based on Netlify's redirection system. Please file an issue if you notice any difference between Netlify's behavior and any of the libraries here.
Refer to the following for compatibility information
| Feature | redirects-parser |
redirects-ktor |
servine |
|---|---|---|---|
_redirects files |
🟡 (1) | 🟡 (1) | 🟡 (1) |
| Redirections | ✅ | ✅ | ✅ |
| Rewrites | ✅ | ✅ | ✅ |
| Shadowing | ❌ | ❌ | ❌ |
| HTTP Status codes | ✅ | 🟡 (2) | 🟡 (2) |
| Splats | 🟡 (4) | 🟡 (3) | 🟡 (3) |
| Placeholders | 🟡 (4) | ❌ | ❌ |
| Query parameters | ❌ | ❌ | ❌ |
| Trailing slash handling | 🤷♂️ | ❌ | ❌ |
| Domain-level redirects | ❌ | ❌ | ❌ |
| Redirect by country/language | ❌ | ❌ | ❌ |
| Redirect by cookie | ❌ | ❌ | ❌ |
✅ Fully supported | 🔧 Can be optionally enabled | 🟡 Partially supported | ❌ Not supported | 🤷♂️ Not applicable
- These files can be parsed, but not all features are supported -- refer to the table to know which ones are.
- Only status codes 302, 301, 404 and 200 are supported.
- The post-url
*is supported, but the:splatplaceholder is not, nor is*anywhere except at the end of the URL. - Parsed as a regular string -- not exposed in any particular way. This is not actively tested and will be at a later date.
See the module's README file for more information.
See the module's README file for more information.