I've been doing some testing of our Umbraco 6.1.5 site with the current Url tracker version 2.2.3 and have come up with a couple of issues with the url tracker. Our users have a policy of unpublishing content rather than deleting it (since it is sometimes reused at a later date) so these are the sorts of things they will be doing:
* If you move a published node, then unpublish it, then try to visit the original node url, a blank page is presented in the browser (chrome), rather than receiving a 410 Gone (or i would actually prefer to receive a 404 - see below). Further investigation shows that the url tracker code is returning a 301 redirect response, however without a url to redirect to.
* If you unpublish a node, then re-publish it, then move it, requests to the original url receive a 410 Gone response, rather than being redirected to the new node url location. Further investigation shows that a redirect entry for the move is not created in the url tracker table, and the 410 entry remains in the table (against the original location of the node).
We actually don't want to send 410 Gone responses, but to treat deleted nodes simply as not found content (with our standard 404 error page that provides options to search for content on the site). Do you know of any way to accomplish this with the current version of the URL tracker, or would it be possible to include an additional setting that allows 410 Gone to be ignored (ie. to perform standard 404 processing instead of responding with 410)?
Thanks for the feedback Bruce, I'll look into it in the future.
There is no setting (yet) to disable the 410 Gone behavior, but maybe you could use IIS configuration to show your 404 page when a 410 status code is returned? (http://www.iis.net/configreference/system.webserver/httperrors)
I've tried playing with the IIS config but can't quite get the behaviour that we require.
As a temporary solution, i've discovered that if i comment out the subscription of the content_BeforeClearDocumentCache event handler in your code (so that 410 entries are not created in our database) then we seem to get the redirection and 404 handling that we want (further testing required, but so far so good). We can revert back to your packaged version if/when you have time to update it. Thanks.
@kipusoep Is it now possible to control when a 410 is returned instead of a 404 for unpublished content? Ideally it would also be good to have the ability to return the 404 page for those requests with a 410 response but unfortunately your solution won't work in our case where we have a multi-site install and each language has it's own 404.
"Is it now possible to control when a 410 is returned instead of a 404 for unpublished content?"
Nope
"Ideally it would also be good to have the ability to return the 404 page for those requests with a 410 response but unfortunately your solution won't work in our case where we have a multi-site install and each language has it's own 404."
To be honest, it's not the UrlTracker's responsibility what is shown when a 404 or 410 occurs. I handle this with my own customErrors code, which show a 404 or 410 page from umbraco when one of these errors occurs and it works really well :-)
Hey @kipusoep
Is there any chance you could detail what your customErrors code is to handle this? I have run into the same problem and I don't seem to be able to solve it. I basically want to be able to redirect users to my a custom error page on 410 in the same way as we do when there is a 404 in Umbraco.
Forgot i asked this question but just came across it again. For anyone else the solution i put in place was as follows:
Update your httpErrors tag in the web.config to something like:
Hi,
I've also searched this topic and so far this is the only working suggestion I've found :) would it be too much to ask you where you placed the map and controller? Thanks!
Hey,
the Route map should inherit ApplicationEventHandler I think and your controller needs to be created in controllers and have the appropriate name that is used in your route so in my example above:
controller = "Error",
action = "GetErrorPage"
I hope that helps. i noticed in the newer versions of Umbraco there is a native redirect handler so not sure if this package will become obsolete soon.
Redirection problems involving unpublished content
Hi Stefan,
I've been doing some testing of our Umbraco 6.1.5 site with the current Url tracker version 2.2.3 and have come up with a couple of issues with the url tracker. Our users have a policy of unpublishing content rather than deleting it (since it is sometimes reused at a later date) so these are the sorts of things they will be doing:
* If you move a published node, then unpublish it, then try to visit the original node url, a blank page is presented in the browser (chrome), rather than receiving a 410 Gone (or i would actually prefer to receive a 404 - see below). Further investigation shows that the url tracker code is returning a 301 redirect response, however without a url to redirect to.
* If you unpublish a node, then re-publish it, then move it, requests to the original url receive a 410 Gone response, rather than being redirected to the new node url location. Further investigation shows that a redirect entry for the move is not created in the url tracker table, and the 410 entry remains in the table (against the original location of the node).
We actually don't want to send 410 Gone responses, but to treat deleted nodes simply as not found content (with our standard 404 error page that provides options to search for content on the site). Do you know of any way to accomplish this with the current version of the URL tracker, or would it be possible to include an additional setting that allows 410 Gone to be ignored (ie. to perform standard 404 processing instead of responding with 410)?
Thanks,
Bruce.
Thanks for the feedback Bruce, I'll look into it in the future.
There is no setting (yet) to disable the 410 Gone behavior, but maybe you could use IIS configuration to show your 404 page when a 410 status code is returned? (http://www.iis.net/configreference/system.webserver/httperrors)
Thanks for the advice Stefan.
I've tried playing with the IIS config but can't quite get the behaviour that we require.
As a temporary solution, i've discovered that if i comment out the subscription of the content_BeforeClearDocumentCache event handler in your code (so that 410 entries are not created in our database) then we seem to get the redirection and 404 handling that we want (further testing required, but so far so good). We can revert back to your packaged version if/when you have time to update it. Thanks.
@kipusoep Is it now possible to control when a 410 is returned instead of a 404 for unpublished content? Ideally it would also be good to have the ability to return the 404 page for those requests with a 410 response but unfortunately your solution won't work in our case where we have a multi-site install and each language has it's own 404.
@Simon
"Is it now possible to control when a 410 is returned instead of a 404 for unpublished content?"
Nope
"Ideally it would also be good to have the ability to return the 404 page for those requests with a 410 response but unfortunately your solution won't work in our case where we have a multi-site install and each language has it's own 404."
To be honest, it's not the UrlTracker's responsibility what is shown when a 404 or 410 occurs. I handle this with my own customErrors code, which show a 404 or 410 page from umbraco when one of these errors occurs and it works really well :-)
Hey @kipusoep Is there any chance you could detail what your customErrors code is to handle this? I have run into the same problem and I don't seem to be able to solve it. I basically want to be able to redirect users to my a custom error page on 410 in the same way as we do when there is a 404 in Umbraco.
Cheers L
Forgot i asked this question but just came across it again. For anyone else the solution i put in place was as follows: Update your httpErrors tag in the web.config to something like:
Write map a new Umbraco route:
Write the corresponding controller to handle the route:
This should give you the flexibility to customise what ever you need for different error codes etc...
If this is a crazy thing to do let me know but it seems to work for me :)
L
Hi, I've also searched this topic and so far this is the only working suggestion I've found :) would it be too much to ask you where you placed the map and controller? Thanks!
Hey, the Route map should inherit ApplicationEventHandler I think and your controller needs to be created in controllers and have the appropriate name that is used in your route so in my example above:
I hope that helps. i noticed in the newer versions of Umbraco there is a native redirect handler so not sure if this package will become obsolete soon.
Best L
thanks for the speedy reply! will check it out
Hi, I have the same setup as @Lachlann but my 410 responses are all empty, I tried using the same response as 404 (which works)
when I visit http://example.com/NotFound or http://example.com/asdf I see the custom not found page. but when I visit http://example.com/unpublished-page/ I get a 410 with a blank response.
Any ideas?
Here's my web.config setup. (I tried with subStatusCode and prefixLanguageFilePath as per Lachlann's example but didn't make any difference)
Oh wierd, Once I built the controller for /Gone/ instead of using the 404 controller it worked (the only difference being the response code)
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.