Loading

Images Saved as Static Resources Don't Display on the Experience Cloud Site

Publiseringsdato: Jul 9, 2026
Beskrivelse
If you create a static resource that stores an image, you want to use this image on a site page. Let's assume the URL of your static resource is as follows:

https://naX.salesforce.com/resource/13237000/PortalLogo

For example, if you wanted this component to show as a home page component on your site home page, you would create an HTML component that looks like this:

<img src="https://naX.salesforce.com/resource/13237000/PortalLogo">

When logging in as a site user, you notice that the image link is broken.
Løsning

 

Fix: Use the Absolute URL

To make the static resource image available to site users, use a relative URL instead of the absolute URL. The relative URL must include the URL path name of your Experience Cloud site.
For example, change the HTML component's img src: 

/support/resource/13237000/PortalLogo 
replace  /support/ with the URL path of your own Experience Cloud site.
The relative URL resolves correctly regardless of the user's domain, because it is evaluated relative to the site's own URL path.

 

Alternative: Use Externally Available Documents (Salesforce Classic Only)

Another workaround is to upload the image to the Documents tab in Salesforce Classic and enable the "Externally Available Image" setting. This makes the document URL accessible to anyone, regardless of domain.
Note: You do not need to change the URL of the document, since it is stored on Salesforce's servers and is accessible to anyone once the Externally Available Image setting is enabled. The Documents tab is not available in Lightning Experience, so you must access this via Salesforce Classic.

When Used in a Visualforce Page

When referencing a static resource in a Visualforce page, use the URLFOR function instead of a hardcoded URL. See the Additional Resources section for the URLFOR function reference.




 

Flere ressurser

 URLFOR function in visualForce page

Knowledge-artikkelnummer

000387235

 
Laster
Salesforce Help | Article