Infocaster / UrlTracker

An Umbraco package that tracks 404 not found results and helps you redirect visitors to the right page
https://infocaster.net/wat-we-doen/umbraco-plugins/301-url-tracker
MIT License
17 stars 12 forks source link

Redirects don't work on static files #159

Open D-Inventor opened 11 months ago

D-Inventor commented 11 months ago

Hi @D-Inventor. We were in touch recently on another Urltracker issue (DELETE verb). I'm hoping you are able to give me another hand on the following issue. We are using Urltracker v10.3 with Umbraco v10.5. Urltracker is working well for custom 301 redirects we have setup with the exception for static files. We have actually been using Urltracker for many years and recently upgraded our Umbraco environment from v7 to v10. While on v7 we successfully used Urltracker for static redirects, for ".html" pages from a long time ago. Now that we are on v10 we (actually our client) just realized that those redirects are not working anymore. After doing much research I cannot figure out how to get this setup. I'm always getting this generic 404 page from IIS:

This xyz page can’t be found No webpage was found for the web address: xyz/xcvb.html HTTP ERROR 404

We do have a custom 404 page handler setup with Umbraco but not even that is being triggered. I'm not sure if its related to an IIS setting, or something with the startup.cs or if its a config setting with Urltracker. In any event, if you would be able assist me with this that would be much appreciated.

Best regards.

Originally posted by @paraxx2 in https://github.com/Infocaster/UrlTracker/discussions/158

D-Inventor commented 10 months ago

Hi @GreyGhostStudio , thank you for reaching out! Would you be so kind as to create a new issue for this? That will help to keep each issue on topic, and it helps me to keep track of the various issues. I can help you better that way.

geoffbeaumont commented 2 weeks ago

Just run into this issue as well, upgrading a very old (Umbraco 4.6) site to Umbraco 13. The old URLs all had .aspx extensions, and while they are logged as 404 errors UrlTracker won't redirect them (a redirect created from the 404 error appends a / after the .aspx, but it doesn't matter whether this is present or not in the redirect Old Url - it won't be triggered).

Only fix appears to be to put the redirects in Rewrite Rules (IIS web.config in this case) and not use UrlTracker for them.