Copied to clipboard

Flag this post as spam?

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


  • David Zweben 265 posts 749 karma points
    Aug 12, 2020 @ 12:15
    David Zweben
    0

    On custom Url Provider, GetOtherUrls works but GetUrl won't

    I'm having a puzzling issue with a custom URL provider. I'm trying to add the date to the URL of a blog post like so:

    /company/blog/2020/08/12/post-name-here/
    

    Everything I try in the GetUrl method simply results in a message "This document is published but its URL could not be routed", even if all I do is add some characters to the very end. I had my default culture hard-coded in the returned UrlInfo object. The weird part is, if I modify my code so it returns the same URL as the default, it works fine.

    As soon as I move my code to GetOtherUrls, it works fine, but I want to change its primary URL.

    I figured this is some kind of cache issue, but I reloaded the DB cache, un-/re-published the page, and restarted the site, and nothing helped.

    Anyone have any ideas?

  • David Zweben 265 posts 749 karma points
    Aug 12, 2020 @ 12:41
    David Zweben
    0

    I just looked at the source code here, and got a hint from that. It looks like Umbraco tries to confirm that the URL actually routes to some content before it will use it. I wasn't expecting that; I haven't set up the corresponding Content Finder yet. I guess I'll try that and see how it goes.

  • David Zweben 265 posts 749 karma points
    Aug 12, 2020 @ 13:42
    David Zweben
    100

    Once I set up a corresponding Content Finder, everything started working, so this seems to have been the issue: you need a working Content Finder to resolve your custom URL before Umbraco will use it. If Umbraco can't find content that corresponds to your URL, it will just show "This document is published but its URL could not be routed" on the node's Info tab.

Please Sign in or register to post replies

Write your reply to:

Draft