Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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)
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.
"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."
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 :-)
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:
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="410" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="410" subStatusCode="-1" path="/error/410" prefixLanguageFilePath="" responseMode="ExecuteURL" />
<error statusCode="404" subStatusCode="-1" path="/error/404" prefixLanguageFilePath="" responseMode="ExecuteURL" />
Write map a new Umbraco route:
controller = "Error",
action = "GetErrorPage"
Write the corresponding controller to handle the route:
public ActionResult GetErrorPage(RenderModel model, string code)
Response.StatusCode = int.Parse(code);
return View("ErrorPage", new RenderModel(Umbraco.TypedContent(ERROR_PAGE_NODE_ID)));
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 :)
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!
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.
thanks for the speedy reply! will check it out
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.
Here's my web.config setup. (I tried with subStatusCode and prefixLanguageFilePath as per Lachlann's example but didn't make any difference)
<httpErrors existingResponse="Replace" errorMode="Custom">
<remove statusCode="400" />
<remove statusCode="404" />
<remove statusCode="410" />
<remove statusCode="500" />
<error statusCode="400" path="/ServerError.html" responseMode="ExecuteURL" />
<error statusCode="404" path="/NotFound" responseMode="ExecuteURL" />
<error statusCode="410" path="/NotFound" responseMode="ExecuteURL" />
<error statusCode="500" path="/ServerError.aspx" responseMode="ExecuteURL" />
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...
Write your reply to:
Image will be uploaded when post is submitted