When a user navigates to a page that does not exist in the developer portal it brings them to a page that has a title "Page Not Available" and a "Sign in now" call to action with the text. "Either sign-in is required to view this content or no content exists at this URL."
How can I edit this page or change or redirect 404 to another page or location?
Solved! Go to Solution.
While a bit hacky, it is possible to catch this page event with a custom script. Here's an example that would redirect to `/some-other-path` on the same portal:
<script> window.portal = { pageEventListeners: { onLoad: (path) => { var elem = document.querySelector('page-not-found'); if (elem) { // redirect window.location.replace("/some-other-path") } } } }; </script>
I am not aware of any way to customize this page in particular. Pls open an Apigee Support ticket and log this as a feature request so we can track and prioritize accordingly.
While a bit hacky, it is possible to catch this page event with a custom script. Here's an example that would redirect to `/some-other-path` on the same portal:
<script> window.portal = { pageEventListeners: { onLoad: (path) => { var elem = document.querySelector('page-not-found'); if (elem) { // redirect window.location.replace("/some-other-path") } } } }; </script>