Copied to clipboard

Flag this post as spam?

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


  • Caley 14 posts 125 karma points
    Sep 04, 2023 @ 09:06
    Caley
    0

    Avoid accessing pages via the page ID

    Hi! On my site, how can I avoid accessing pages via the page ID?

    For instance, page ID 1802 is the contact page and can be accessed by both mysite.com/1802 and the page name mysite.com/contact

    It should only be accessible by mysite.com/contact

    I have searched for a setting for this, but can't find any? –are there any solutions for this?

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Sep 05, 2023 @ 09:07
    Nik
    100

    Hi Caley,

    There is a configuration option available that will disable looking up pages by ID which I believe will solve your issue:

    https://docs.umbraco.com/umbraco-cms/reference/configuration/webroutingsettings

    The setting you are looking for is DisableFindContentByIdPath

    Thanks

    Nik

  • Caley 14 posts 125 karma points
    Sep 14, 2023 @ 08:56
    Caley
    0

    Hi Nik! That's exactly what it took to make it work. :) Thank you!

    It would be nice if pages were automatically redirected to the right page. Several of my pages, with ID as url, have somehow been indexed by Google and will now result in 404 pages. Do you know a solution for this?

Please Sign in or register to post replies

Write your reply to:

Draft