Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Customize or redirect 404 on developer portal

ojg
Bronze 1
Bronze 1

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 Solved
0 2 240
1 ACCEPTED 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>

View solution in original post

2 REPLIES 2

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>