Hi,@Salvatore Sanollo You may try :
builder.Services.AddRazorPages()
.AddRazorPagesOptions(options =>
{
options.Conventions.AddFolderRouteModelConvention("/", model =>
{
model.Selectors.Remove(model.Selectors.FirstOrDefault(x => x.AttributeRouteModel.Template == ""));
foreach (var selector in model.Selectors)
{
if (!selector.AttributeRouteModel.Template.Contains("welcome"))
{
selector.AttributeRouteModel = new AttributeRouteModel
{
Order = -1,
Template = AttributeRouteModel.CombineTemplates(
"{slug}",
selector.AttributeRouteModel.Template),
};
}
}
});
});
.....
var app = builder.Build();
......
app.MapFallbackToPage("/welcome");
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. Best regards, Ruikai Feng