Apr 2022

I created BulkRedirects to serve multiple redirects from a single text file for .NET web projects. The config format is based on the _redirects format from Netlify.

The library handles redirects between local paths or to a remote URL, and supports HTTP 301 and 302 status codes.

dotnet add package BulkRedirects

Add to application routing:

var builder = WebApplication.CreateBuilder(args);
app.UseBulkRedirects();
app.Run();

Sample config file:

# redirects with comments supported
/home              /
/blog/my-post.php  /blog/my-post
/news              /blog
/dogs              https://www.akc.org/dog-breeds/

Comments

No comments posted.