Copied to clipboard

Flag this post as spam?

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


  • MB 273 posts 936 karma points
    Jan 09, 2017 @ 19:00
    MB
    0

    Shorten URL's

    Hey guys,

    I've done some research on how to shorten URL's in Umbraco 7 but without much luck.

    I have some really long URL's like this one:

    www.domain.com/produkter/cykler/mountain-bikes/specialized/demo

    I would like to set up some rules that says:

    IF you are on Document Type: productPage then change URL from:

    /produkter/cykler/mountain-bikes/specialized/epic-fsr/

    To

    /mountain-bikes/specialized/epic-fsr

    EDIT - SOLUTION:

    I ended up using VirtualNodes instead, which worked

  • Amir Khan 1287 posts 2744 karma points
    Jan 09, 2017 @ 19:55
    Amir Khan
    1

    Hi Mike, take a look at this package: https://our.umbraco.org/projects/developer-tools/routing/

    If you're looking for a more custom solution, the Request Pipeline is what you'll want to look into: https://our.umbraco.org/documentation/reference/routing/Request-Pipeline/

    Hope this helps,

    Amir

  • MB 273 posts 936 karma points
    Jan 10, 2017 @ 10:06
    MB
    0

    Hey Amir!

    I installed the Routing plugin but from what I can understand, the plugin only "redirects" you if you are on a specific Url Segment.

    Like, If I'm on

    /produkter/cykler/racercykler/

    I could redirect to the frontpage but keep the URL intact, isn't that correct?

    I'm looking to remove a part of the URL so that this:

    /produkter/cykler/mountain-bikes/specialized/

    Becomes this:

    /mountain-bikes/specialized/

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 09, 2017 @ 20:08
    Nicholas Westby
    1

    Here's another package on top of Amir's recommendation: https://our.umbraco.org/projects/backoffice-extensions/omit-segments-url-provider/

  • MB 273 posts 936 karma points
    Jan 10, 2017 @ 10:40
    MB
    0

    Hey Nicholas,

    Thank you for your reply.

    Reading the plugins description, it seems to be the right solution. Although, I'm not sure if it works with Umbraco 7.5.6.

    An example Adding a line to the Web.config file (in the appSettings) like this one does nothing:

    <add key="omiturlsegments:brandPage" value="enduro"/>
    

    If I'm on productPage I'd like to remove productBrandModel

    enter image description here

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 10, 2017 @ 16:17
    Nicholas Westby
    1

    I think the value you specified is incorrect (it seems you specified a node name rather than a document type alias). Instead, I think you want this:

    <add key="omiturlsegments:brandPage" value="productBrandModel"/>
    

    That should exclude the "enduro" segment of the URL.

  • MB 273 posts 936 karma points
    Jan 10, 2017 @ 18:28
    MB
    1

    I must be missing something because it makes no difference... I'll try a few things and see if I can get it to work.

    Edit:

    I installed the authors other plugin: VirtualNodes which did the trick!

    Installed the plugin and used:

    <add key="virtualnode" value="productSection, productType" />
    
Please Sign in or register to post replies

Write your reply to:

Draft