Configure web.config

Depending on your topology, add this key in the appSettings section in the Web.config file on your CD server:

XM:

<add key="sxaxm:define" value="sxaxmonly" />

XP:

<add key="sxaxm:define" value="sxaxconnect" />

Replace this

<add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" name="Sitecore.MediaRequestHandler"/>

With this

<add verb="*" path="sitecore_media.ashx" type="Sitecore.XA.Foundation.MediaRequestHandler.MediaRequestHandler,Sitecore.XA.Foundation.MediaRequestHandler" name="Sitecore.MediaRequestHandler"/>
If you have suggestions for improving this article, let us know!