/Bulk Redirects

Bulk Redirects

2
v0.0.1

Traefik Plugin Bulk Redirects

release report OpenSSF Scorecard Coverage Status license

A Traefik middleware plugin for Cloudflare-style bulk redirects. It allows defining multiple redirects in a single Traefik Middleware configuration. This plugin supports exact redirects, subpath redirects, query string preservation, and configurable redirect status codes.

Redirect fields

KeyDescription
sourceURLabsolute source URL to match
targetURLabsolute redirect destination URL
statusCoderedirect status code: 301, 302, 303, 307, 308
preserveQueryStringenabled appends the original query string to the target URL
subpathMatchingenabled matches the source path and all child paths below it

Configuration

Example usage

apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: bulk-redirects
spec:
plugin:
bulkRedirects:
redirects:
- sourceURL: https://example.com/premium/coupon
targetURL: https://example.com/en/premium/
statusCode: 302
preserveQueryString: enabled
subpathMatching: disabled
- sourceURL: https://example.com/docs
targetURL: https://example.com/en/resources
statusCode: 301
preserveQueryString: enabled
subpathMatching: enabled

Static configuration

experimental:
plugins:
bulkRedirects:
moduleName: github.com/doodlescheduling/traefik-bulk-redirects
version: v0.0.1