How to redirect any page to page not found?

Recently we had a query to redirect pages to page not found in multilingual implementation. The request was very simple, if the page has a language version then it should load and if the page does not have language version then it should redirect to page not found.

Initially the team thought of implementing the changes in Link Manager. And then we remember that Sitecore provides a field which works like a charm for this requirement.

You need to check the field “Enforce Version Presence” and it will check if the language version is present or not, and then it redirects to the page not found.

Hope it helps!

Thank you.. Keep Learning.. Keep Sitecoring.. 🙂

Leave a comment