Page-level cross-domain redirect for a subdomain that loads proxy-rewrite JS
Last Updated: October 22, 2024
This document helps you to better understand redirecting a singleSubdomain
page to VA.gov
. This is a page-level cross-domain redirect using the proxy-rewrite JavaScript (JS) app. For more information about redirects, return to the Redirect Implementation Strategy page.
The Sitewide Content, Accessibility & Information Architecture team (CAIA) reviews all URL redirects before routing them to the appropriate engineer.
Before you attempt a redirect, follow these two important steps:
Read the Design System guidance for redirects.
This is a client-side redirect
Subdomain
to VA.gov
redirects are client-side redirects. A client-side redirect uses JavaScript (JS). This primarily applies to TeamSite pages that use the injected header and footer, and therefore load the proxy-rewrite JS app. During a client-side redirect, the proxy-rewrite JS app checks for any documented redirects. If a redirect exists, it sends the user to the page’s new destination.
Client-side redirects should only be used when absolutely necessary.
Client-side redirects are not ideal, as they require JavaScript to be enabled and running correctly in order for a user to be redirected properly. A client-side redirect also depends on the legacy page staying alive and should, therefore, be considered a temporary solution.
Information Table: Subdomain
to VA.gov
Redirects
Below is a table that outlines the details of a Subdomain
to VA.gov
redirect.
| |
When to use this redirect: | When a single page within a TeamSite should redirect to |
Real world example: | The National Cemetery Association TeamSite (www.cem.va.gov) uses the injected header and footer. An example page-level redirect from TeamSite to the modernized |
How it works: |
Consider if the redirect should be a |
Code location: | https://github.com/department-of-veterans-affairs/vets-website/blob/main/src/applications/proxy-rewrite/redirects/crossDomainRedirects.json#L3C1-L5C46 Any Platform or VFS engineer with repo access may modify. |
Additional Info: | You can verify if a site loads proxy-rewrite by checking the proxy-rewrite-whitelist.json. Typically these sites will display the injected modernized header/footer, but in some cases, sites may load the proxy-rewrite JS but not yet display the injected header. |
Team Responsibilities: | CAIA must sign off on request. |
Special Note
❌ Do not archive redirected TeamSite pages. Instead, product team should implement the client side redirect, with additional ask of VA stakeholder to:
✅ Replace their page content with a 'redirect' message and
✅ Update their print materials and nav links with the new URL
Additional Resources
To learn more about redirects, visit Redirect Implementation Strategy page.
To learn about redirects involving Drupal, visit Drupal Redirects.
For information on redirecting forms like PDFs, visit Redirecting static documents.
For any questions regarding redirects, contact the CAIA team in their Slack channel #sitewide-content-accessibility-ia.
Help and feedback
Get help from the Platform Support Team in Slack.
Submit a feature idea to the Platform.