I wonder if anyone could shed any light on something that I don’t think is possible…..
A site is being decommissioned and the site owners have supplied an enormous list of URL redirects (5000) to be enforced. The vast majority of the entries on this list all redirect to a generic landing page.
So, the question is is there a way to use the HTTP redirect functionality in the web config to handle specific redirects (oldsite.com/page1 to newsite.com/page1, oldsite.com/page2 to newsite.com/page2, etc etc) and have anything that’s not in the list of specific redirects be directed to the generic landing page?
Thanks,
C
2
Answers
Yes, I’d think so. The IIS Rewrite module lets you define any number of redirect rules and I believe they will be executed "in turn". So you should be able to create rule(s) for the specific URLs (oldsite/page1 -> mewsite/page1 etc) and then have a catch-all after those. https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module#creating-a-redirect-rule
Yes, you can use the rewrite module in IIS to handle specific redirects and route content outside the specific redirect list to the generic login page.
The following is an example of how to set up redirect rules in web.config: