Reactive applications do not have the option of using the same SEO rules that Traditional apps can. In order to use a custom domain, they use Site Redirect Rules. Site Redirect Rules are examined for every URL to see if there is a match. If there is a large number of redirect rules, performance can be noticeably affected.
This application demonstrates a method for client-side redirection which is simple to implement and low impact, since it only affects the applications you use it on. You can also change your custom domains at any time using the Site Property, with no code changes.
The method depends on the ReplaceURLDomain method from the HTTPRequestHandler extension. The current URL is compared with the result returned from the ReplaceURLDomain method, using the CustomDomain site property, and if the current URL is different than the result returned, the user is redirected to the same page using the custom domain.
The developer chooses a common widget in the end-user module that is used by all of the screens, and adds the code to the OnReady event, so that the redirection takes place before anything is rendered.
For Demo purposes only, this application uses an anonymous page.