I used RewriteOptions to add "/" to end all urls, but when publishing to the iis server I get a "page does not redirect correctly" error.
i using this
var options = new RewriteOptions() //add '/' to end of url
.AddRedirect("(.*[^/])$", "$1/")
.AddRedirectToHttpsPermanent();
app.UseRewriter(options);
Can you suggest a suitable pattern?
Well, assuming you have already installed URL Rewrite Modulefrom the below official site. Here is the reference for you.
Configure URL Rewrite Pattern and Rules:
As, so far your requirement is to add additional slash /
of your website, Thus,you can set this (.*[^/])$
pattern on your URL Rewrite module in IIS as below:
Steps for configuration:
Note: You can customize your rules as well. If you encounter any concern on this you can have a look below screen capture how to do it.
If you still need more further assistance, you could have look on our official document here