I created a web.config file on root of the project and then wrote the rewrite rules in a local clone. After I push it to live environment it does not reflect the rules written.
My web.config file is:
Problem is:
When I search for xyz.nl it should redirect to https://www.xyz.nl, but it does not redirect.
Does asp.net core support classic's asp.net configs? I don't think so.
You could achieve redirect in .net core app in multiple ways, but if you want something close to classy way, then do following:
Create IISUrlRewrite.xml in a root of your site. Name can be any, but content will be following:
<?xml version="1.0" encoding="utf-8" ?>
<rewrite>
<rules>
<!-- Your rules here -->
</rules>
</rewrite>
Add rewriter pipeline to Program.cs:
WebApplication app = builder.Build();
await app.BootUmbracoAsync();
var rewriteOptions = new RewriteOptions()
.AddIISUrlRewrite(app.Environment.ContentRootFileProvider, "IISUrlRewrite.xml");
app.UseRewriter(rewriteOptions);
app.UseStaticFiles();
Rewrite rules Umbraco 13
Hi,
I created a web.config file on root of the project and then wrote the rewrite rules in a local clone. After I push it to live environment it does not reflect the rules written.
My web.config file is:
Problem is: When I search for xyz.nl it should redirect to https://www.xyz.nl, but it does not redirect.
Hi!
Does asp.net core support classic's asp.net configs? I don't think so. You could achieve redirect in .net core app in multiple ways, but if you want something close to classy way, then do following:
Create IISUrlRewrite.xml in a root of your site. Name can be any, but content will be following:
Add rewriter pipeline to Program.cs:
Hi,
I have already tried this method following the Umbraco documentation: https://docs.umbraco.com/umbraco-cms/reference/routing/iisrewriterules
But the problem was not solved.
is working on a reply...