I created the following rule in config/UrlRewriting.config, but which fixed the above issue, but created an issue where all of the backoffice paths are returning 404:
Turns out I was being a dufus. Umbraco actually requests resources that have .html extensions, and my regex was grabbing those and stripping the .htm from them. Just had to check for the beginning and end of the string, and now we're golden:
Url Rewrite .htm to extensionless, but ignore umbraco directories
I need to redirect all of the legacy .htm urls for my website to extensionless urls, so:
I created the following rule in config/UrlRewriting.config, but which fixed the above issue, but created an issue where all of the backoffice paths are returning 404:
So requests like these are returning 404:
I'm pretty sure my problem is with my regex, but I'm not sure. Anyone care to advise?
Turns out I was being a dufus. Umbraco actually requests resources that have .html extensions, and my regex was grabbing those and stripping the .htm from them. Just had to check for the beginning and end of the string, and now we're golden:
Glad you figured it out. For future reference, you can also use a negative lookahead to ignore particular paths (e.g., Umbraco):
Thanks for the tip Nicholas. One of these days I need to sit down and actually put some effort into memorizing regex syntax :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.