I have been searching this forum for a solution to my problem but can’t seem to find one.
My client's problem is that none of the autogenerated redirects works, it only returns 404. The strange thing is that if I check force redirect it works even if I uncheck it again after saving. We use v. 3.11 of url tracker and Umbraco v 7.9.2.
We don’t have this problem in our dev environment or test server so can’t really pin point the problem.
Essentially though, when you force a redirect, the redirect is 'looked for' before the request is handled by Umbraco, once you've received that redirect it will cache in your browser, so that is how sometimes it can seem like the redirect is still happening, after you have unforced it.
to be clear on what is being redirected (you'll see if multiple redirects are occurring etc)
Anyway, if you can add a brand new url for redirecting, without forcing, and it redirects ok, then the likely problem with the one that 'won't redirect' unless you force it is that there is an existing entry in the UrlTracker database table that is taking precedence over your new url.
You'd expect more recently created redirects to always take precedence over previously created one, but that isn't always the case, so suggest one line of investigation is to look in the UrlTracker database table for any other entries (could be 404 tracking entry) for the url you are trying to redirect, and if you find any, manually remove them.
After checking the url tracker table in the db I can see why it won’t redirect but don’t know how to fix it. The column RedirectNodeId is null. Even if I create a new redirect it still writes null on the RedirectNodeId column. In my dev environment and test server it writes the nodedi of the page that it redirects to also the column Is404 is set to false on all redirects in dev and test but the opposite in production where it is set to true. Maybe I should start an issue on their github page instead.
If I create a new redirect I get 404. It sill start working if I check force. The strange thing is that it works on test server and dev environment without any problems. I will follow your advice an check the database to se if there is something there that causes the problem.
Yes, so what that means is an earlier request was made to your production site before the redirect was in place.
You have UrlTracker setup to track 404 redirects
So that created an entry in the database table in production for your particular Url - and it's marked as being Is404.
You'd expect that creating a new redirect for this url would take precedence over the earlier 404 entry, but it doesn't (not consistently)
So if you completely delete from the database your earlier 404 entry.
Trigger an application pool recycle
Then your new redirect should work.
regards
Marc
NB if you are not 'doing anythign' with the 404 information that UrlTracker is storing, you could delete all the 404 entries... there will be millions, as one is created for each 404!
There is an appsetting to turn the functionality off:
301 url tracker returns 404
I have been searching this forum for a solution to my problem but can’t seem to find one.
My client's problem is that none of the autogenerated redirects works, it only returns 404. The strange thing is that if I check force redirect it works even if I uncheck it again after saving. We use v. 3.11 of url tracker and Umbraco v 7.9.2.
We don’t have this problem in our dev environment or test server so can’t really pin point the problem.
I’m thankful for any help I can get.
Hi Christian
There is a an issue tracker for Url Tracker here: https://github.com/kipusoep/UrlTracker
And there is a later version of UrlTracker available via NuGet: https://www.nuget.org/packages/UrlTracker/
(3.15)
Essentially though, when you force a redirect, the redirect is 'looked for' before the request is handled by Umbraco, once you've received that redirect it will cache in your browser, so that is how sometimes it can seem like the redirect is still happening, after you have unforced it.
I tend to use this site to test redirect issues:
http://www.redirect-checker.org/index.php
to be clear on what is being redirected (you'll see if multiple redirects are occurring etc)
Anyway, if you can add a brand new url for redirecting, without forcing, and it redirects ok, then the likely problem with the one that 'won't redirect' unless you force it is that there is an existing entry in the UrlTracker database table that is taking precedence over your new url.
You'd expect more recently created redirects to always take precedence over previously created one, but that isn't always the case, so suggest one line of investigation is to look in the UrlTracker database table for any other entries (could be 404 tracking entry) for the url you are trying to redirect, and if you find any, manually remove them.
regards
Marc
After checking the url tracker table in the db I can see why it won’t redirect but don’t know how to fix it. The column RedirectNodeId is null. Even if I create a new redirect it still writes null on the RedirectNodeId column. In my dev environment and test server it writes the nodedi of the page that it redirects to also the column Is404 is set to false on all redirects in dev and test but the opposite in production where it is set to true. Maybe I should start an issue on their github page instead.
Thanks for your replay.
If I create a new redirect I get 404. It sill start working if I check force. The strange thing is that it works on test server and dev environment without any problems. I will follow your advice an check the database to se if there is something there that causes the problem.
Hi Christian
Yes, so what that means is an earlier request was made to your production site before the redirect was in place.
You have UrlTracker setup to track 404 redirects
So that created an entry in the database table in production for your particular Url - and it's marked as being Is404.
You'd expect that creating a new redirect for this url would take precedence over the earlier 404 entry, but it doesn't (not consistently)
So if you completely delete from the database your earlier 404 entry.
Trigger an application pool recycle
Then your new redirect should work.
regards
Marc
NB if you are not 'doing anythign' with the 404 information that UrlTracker is storing, you could delete all the 404 entries... there will be millions, as one is created for each 404!
There is an appsetting to turn the functionality off:
If you keep the 404 tracking functionality then consider ignoring common 404 requests eg
is working on a reply...