I’m trying to set up a url rewrite using the UrlRewriting.config file in Umbraco.
Am I correct in thinking that the URL Rewriting uses Perl-compatible regular expressions?
I need to redirect from /events.aspx$ to about-us/events.aspx$, but obviously this causes an endless loop, resulting in a URL which looks like about-us/about-us/about-us/about-us/events.aspx etc.
Is there a way that I can stop the endless loop happening here? Apologies if this has already been answered elsewhere – it’s a hard scenario to explain.
You should use
^/events.aspx$(i.e. starts with /events.aspx) in the rewrite condition and then rewrite the URL toabout-us/events.aspxso that the next time the request comes to the URL rewriter, the rewrite condition won’t be satisfied. We used to do similar stuff withmod-rewritein apache.