Copied to clipboard

Flag this post as spam?

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


  • Mus'ab 157 posts 385 karma points notactivated
    Aug 25, 2019 @ 14:13
    Mus'ab
    0

    How to modify URL in Umbraco?

    hello every body i want to redirect to nodes through its id in the URL but i want to add some text after id like this sentence http://localhost:13557/node ID-some text or http://localhost:13557/node ID/some text

    how can i do that ?

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Aug 25, 2019 @ 20:11
    Marc Goodson
    0

    Hi Mus'ab

    When a request is made to Umbraco a series of 'ContentFinders' are executed one after another, with each containing different business logic to try to route the Incoming Url to a corresponding Umbraco content item, if a particular rule doesn't match, the next ContentFinder in the queue 'has a go' to try and match the incoming Url etc

    You can add your own rules by implementing your own ContentFinder and adding it to the queue of ContentFinders.

    There is an example here in the docs:

    https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/IContentFinder

    Your custom ContentFinder could issue a 301 redirect if required.

    regards

    Marc

  • Jonathan Distenfeld 105 posts 618 karma points
    Aug 27, 2019 @ 14:37
    Jonathan Distenfeld
    0

    Hi Mus'ab,

    not sure what you are trying to achive but isn't this possible with a querystring?

    http://localhost:13557/nodeID?someVar=someText

    ~ Jonathan

  • Mus'ab 157 posts 385 karma points notactivated
    Aug 27, 2019 @ 15:27
    Mus'ab
    0

    Hi Jonathan,

    If I am not mistaken, the query string is not a good practice regarding to Google's SEO standards.

  • Jonathan Distenfeld 105 posts 618 karma points
    Aug 28, 2019 @ 13:18
    Jonathan Distenfeld
    0

    Hi Mus'ab,

    you are right, but why is that?

    The reason why query strings are not very good for seo is 1. duplicate content and 2. keyword cannibalization. Both of these reasons come from url's that are different but the page showing is still basically the same (in keywords and content).

    But your question is how to add some text to url. So is there a way to do that without running into these seo-problems? No, if you are running into these problems using querystring, you will also run into them with different url-structure.

    However there are some things you could do to solve these problems like Canonical-Tags, NoIndex-Entrys etc.

    https://moz.com/community/q/query-string-parameters-always-bad-for-seo

    ~ Jonathan

  • Mus'ab 157 posts 385 karma points notactivated
    Aug 28, 2019 @ 14:00
    Mus'ab
    0

    Hi Jonathan

    The main problem is that i have a nodes with so long name that generate a (Max URL length Error) and the only solution i have is to use node id in URL instead of ordinary URL and add short brief of the name

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Aug 28, 2019 @ 14:28
    Marc Goodson
    0

    Hi Mus'ab

    If you add a new textbox property to your document types with an alias 'umbracoUrlName'

    Then editors could provide a shorter version of the title for the Url, and Umbraco will automatically change the Url to use the shorter version.

    https://our.umbraco.com/Documentation/Reference/Routing/routing-properties

    regards

    Marc

  • B. Gunnarsson (Bryns) 25 posts 180 karma points c-trib
    Aug 28, 2019 @ 15:40
    B. Gunnarsson (Bryns)
    0

    +1 we use this textbox approach and it works well.

  • Mus'ab 157 posts 385 karma points notactivated
    Sep 10, 2019 @ 13:05
    Mus'ab
    0

    Hello Marc Goodson

    thanks a lot for your help
    its work but the problem unfortunately didn't solved if i fill the text box with long string the page will return the maximum URL length error
    i think that the only way to solve this problem is committed to a maximum length in the text box

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Sep 10, 2019 @ 18:07
    Marc Goodson
    0

    Yes I wasn't thinking it would allow you to be able to create longer URLs! That is a limit outside of Umbraco's control!!

    But it would allow you to have a long page name/title... But provide a shorter version for the URL...

    ... There are a couple of plugins that would allow you to set a character limit on the textbox...

    To prevent people accidentally making the URL too long

    Regards

    Marc

  • Mus'ab 157 posts 385 karma points notactivated
    Sep 12, 2019 @ 10:20
    Mus'ab
    0

    thank you at all

Please Sign in or register to post replies

Write your reply to:

Draft