Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fabio Milheiro 74 posts 136 karma points
    Oct 19, 2012 @ 12:56
    Fabio Milheiro
    0

    uComponents 301 Moved Permanently handler not working

    We have uComponents 5 installed in Umbraco 4.8.1.

    There's a base document that has the property umbraco301MovedPermanently and I set it to /oldpage.

    I have added the NotFoundHandlers.SearchFor301MovedPermanently handler to the 404handlers.config file as you can see below:

     

    <NotFoundHandlers>

      <notFound assembly="umbraco" type="SearchForAlias" />

      <notFound assembly="umbraco" type="SearchForTemplate"/>

      <notFound assembly="umbraco" type="SearchForProfile"/>

      <notFound assembly="uComponents.Core" type="NotFoundHandlers.SearchFor301MovedPermanently" />

      <notFound assembly="umbraco" type="handle404"/>

    </NotFoundHandlers>

     

     

    But when I try to load thesite.com/oldpage it is not working. I am simply getting a 404 which it seems to be be thrown by handle404, right?

     

    Server Error

    404 - File or directory not found.

    The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

     

    What else do I need to do to make this work?

     

     

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 19, 2012 @ 13:04
    Lee Kelleher
    1

    Hi Fabio,

    In v5 the NotFoundHandlers have moved into their own DLL.  Try this instead:

     <notFound assembly="uComponents.NotFoundHandlers" type="SearchFor301MovedPermanently" />

    Cheers, Lee.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 19, 2012 @ 13:06
    Lee Kelleher
    1

    Actually, it looks as if IIS is handling the 404 pages instead of Umbraco.

    You may need to add the following to your Web.config, inside the <system.webServer> section:

    <httpErrors existingResponse="PassThrough" />

    Cheers, Lee.

  • Fabio Milheiro 74 posts 136 karma points
    Oct 19, 2012 @ 16:57
    Fabio Milheiro
    0

    Mmmm... Thanks for your supoprt Lee!

    I have now changed the assembly reference to uComponents.NotFoundHandlers and added the httpResponse element to the web.config but still nothing.

    Now in my development machine, I am getting this error message from Umbraco:

    Page not found

    No umbraco document matches the url 'http://local.********.org.uk/oldpage'

    umbraco tried this to match it using this xpath query'/root/* [@urlName = "oldpage"] | /root/*/* [@urlName = "oldpage"]')

    This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. Just add the id to the '/settings/content/errors/error404' element.

    For more information, visit information about custom 404 on the umbraco website.

    This page is intentionally left ugly ;-)

     

    Any other suggestions on why this is still not working?

  • Fabio Milheiro 74 posts 136 karma points
    Oct 19, 2012 @ 17:05
    Fabio Milheiro
    0

    This might help, if I change the name of the type in the notfound element, the problem is not noticeable meaning the app is not even trying to load the type SearchFor301MovedPermanently. Why?

  • Fabio Milheiro 74 posts 136 karma points
    Oct 19, 2012 @ 17:50
    Fabio Milheiro
    0

    Apparently the leading slash as the problem in both staging and development environments.

    Thanks Lee!

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 22, 2012 @ 11:32
    Lee Kelleher
    0

    Cool, glad you found the issue.

Please Sign in or register to post replies

Write your reply to:

Draft