Loading
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Assign Salesforce Site Error Pages

          Assign Salesforce Site Error Pages

          Salesforce sites use Visualforce pages for site and error pages. Sample error pages use the SiteSamples static resource for their style sheet and images.

          Required Editions

          Available in: both Salesforce Classic and Lightning Experience
          Available in: Developer, Enterprise, Performance, and Unlimited Editions
          User Permissions Needed
          To create and edit Salesforce Sites:

          Customize Application

          OR

          Create and Set Up Experiences

          Warning
          Warning To avoid errors, don't rename or delete SiteSamples.

          To set the error pages for your site:

          1. From Setup, enter Sites in the Quick Find box, then select Sites.
          2. Click the name of the site you want to modify.
          3. Click Page Assignment on the Error Pages related list.
          4. Using the lookup fields, assign a Visualforce page or static resource for each of the standard error conditions listed:
            • Authorization Required Page—The page users see when trying to access pages for which they don’t have authorization.
            • Limit Exceeded Page—The page users see when your site has exceeded its bandwidth limits.
            • Maintenance Page—The page users see when your site is down for maintenance.
            • Service Not Available—No longer applicable. This custom page was previously used when Salesforce servers were unavailable for HTTP-only requests, which are no longer supported. When Salesforce servers are unavailable for a Salesforce Site, the Maintenance page is displayed.

              Tip
              Tip To display a custom page when Salesforce servers are unavailable, use Experience Cloud sites.
            • Page Not Found Page—The page users see when trying to access a page that can’t be found. You can use the action attribute on an <apex:page> component to redirect the Page Not Found error page. Using this kind of redirect on any other error pages will redirect users to the Maintenance page.
            • Generic Error Page—The page users see when encountering generic exceptions.
            Note
            Note When using static resources in a custom error page—such as a large image file or a large CSS file contained in a static resource .zip file—each individual resource must be no larger than 50 KB. Otherwise, a 404 not found error is returned for that resource.
          5. Save your changes.
          6. To view the associated page as it appears in a browser, on the Site Details page, click Preview.
            Tip
            Tip Add the <site:previewAsAdmin /> component right before the closing </apex:page> tag in your custom Visualforce error pages to view detailed site error messages in administrator preview mode.

            For inactive sites, the default error page is the Under Construction page, and can’t be overridden using page assignments. You can override the default error page by assigning a simple HTML custom Visualforce page in the Inactive Site Home Page field.

          What Happened to My Custom Error Page?

          In certain circumstances, when you configure your site to display a custom error page, your site displays the standard Service Not Available page instead. This change happens by design when you switch to using the Salesforce content delivery network (CDN). This change also happens for sites that switch to using enhanced domains, because the Salesforce CDN is enabled by default for enhanced domains.

          If you want to use a custom-branded error page, you have two options.

          Interested in the technical details? When you enable the Salesforce CDN, your site traffic goes through our CDN partner. When our CDN partner receives 500, 502, 503, or 504 response codes from Salesforce, it responds with a 503 error code and displays the default Service Not Available page.

           
          Loading
          Salesforce Help | Article