简体   繁体   中英

URL Rewriting Middleware In ASP.NET Core - printed from the database

That's the way I have to make 301 Moved permanently to a new page from the old side.

I have basically done so that if people get into the old url they will be thrown over to the new url.

How can I do it by taking content from the database.

I work with .net core 2.0

How do I call the database into Startup.cs?

Right now I have this piece of code on startup.cs

public void ConfigureServices(IServiceCollection services)
    {
        var optionsValue = new RewriteOptions()
            .AddRedirect("", "")
            .AddRewrite(@"", "", skipRemainingRules: true);
    }

考虑创建自己的IRule并在ApplyRule重定向。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM