htmlurlhttpsesiedge-side-includes

<esi:include> with network-path reference


I just discovered that performing an <esi:include src="url" /> using a network-path reference is not possible; it returns an error in the inclusion.

Is possible to include an absolute URL omitting the protocol/scheme?

I need to include pages via http or https depending on the protocol/scheme of the calling page

(so include http://example.com/included if I'm including in http://example.com/container, or include https://example.com/included if I'm including in https://example.com/container)


Solution

  • I just found that my problem was not with ESI Include.

    The inclusion can always be done via https and doesn't need to be adaptable to http or https; obviously it happens on server-side.

    My specific problem was instead client-related, cause the resources (CSS, JS) from the included code were getting the scheme/protocol from the <base href> set in the container; so the cause was the latter one (that was always set to http), not because of the ESI include.