How to Restrict Apigee Integrated Portals to Only Use Custom Domains

In Apigee Integrated Developer Portals custom domains can be configured for accessing portals using your own domain names.

However, it is not possible to disable the apigee.io domain names generated by default. The reason for this is that Apigee internally use apigee.io domain of the portal for resolving the custom domain configured.

Nevertheless, you could add following JavaScript code in the portal's custom scripts section for redirecting HTTP requests sent using apigee.io domain to custom domain by preserving the complete request URL. Please update values of apigee_io_domain and custom_domain variables accordingly:

<script>
apigee_io_domain = 'foo-portal.apigee.io'
custom_domain = 'portal.foo.org';
var url = String(window.location);
if(url. includes(apigee_io_domain)) {
   window.location.href = url.replace(apigee_io_domain, custom_domain);
}
</script>
Version history
Last update:
‎05-28-2020 08:36 PM
Updated by: