When a path that is outside of a domain's custom URLs' path prefixes is accessed on a domain that does not have a root site, error is shown
Last updated 2021-08-13 ·Reference W-6219031 ·Reported By 42 users
When a request is made on a domain for a path that does not match any of its custom URLs' path prefixes, which means that no custom URL on that domain uses the '/' root path prefix, the error page that is rendered is Salesforce's generic down-for-maintenance page and not a configurable error page.
To reproduce this issue, access a path that does not exist on a domain that has no '/' root path prefix in its custom URLs. If the first site on the domain, as sorted by the path prefixes in the domain's custom URLs, is a Force.com Site or a Community Force.com Site, Salesforce's generic down-for-maintenance page is displayed instead of that site's 404 error page.
1. Create a new site or community.
2. Set the path prefix of the site to not be the root '/' path prefix, and ensure that no sites use the root '/' path prefix.
3. Access the domain of the site or community with a page that does not exist. Ex. https://example.force.com/page
4. Confirm that you get the Salesforce maintenance page
To work around this issue, create a separate Force.com Site with its error pages set to your custom 404 error page. Attach that site to the '/' root path prefix of the domains that require this. Unknown paths on that domain that are outside of that domain's custom URLs' path prefixes will then get served by the root site's custom 404 error page.
1. Go to Setup | App Setup | Develop | Sites. Click on the New button.
2. Fill in the mandatory fields and save the new site. Leave the Default Web Address field empty if the domain that this is needed on is the force.com subdomain.
3. Click on the Page Assignment button in the Error Pages related list.
4. Set all the error pages, except for the Service Not Available page, to your custom Visualforce page for the 404 error and press Save. The Service Not Available field is a static resource and not a Visualforce page.
5. If this workaround is needed on a custom domain, click on the New Custom URL button, set the Domain to the custom domain that this workaround is needed on, ensure that the Path field is set to the / value, and press Save.
Note: This workaround only works for force.com site
As force.com site and community site use different domain, it is not possible to attach a force.com site to the '/' root path prefix of the community domains that require this, so if it is a force.com site, you can create a force.com site in the root path to workaround this and redirect to the 404 error page of the root path force.com site.
If it is a community site, and if you create a community site on the root path of the community domain, currently it is only showing the "URL No Longer Exists" page from the community site in the root path, and you cannot override the 404 error page, so the workaround specified above doesn't apply.
Reported By (42)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.