简体   繁体   English

<esi:include>与网络路径参考

[英]<esi:include> with network-path reference

I just discovered that performing an <esi:include src="url" /> using a network-path reference is not possible; 我刚刚发现无法使用网络路径引用执行<esi:include src="url" /> it returns an error in the inclusion. 它返回包含中的错误。

Is possible to include an absolute URL omitting the protocol/scheme? 是否可以包含省略协议/方案的绝对URL?

I need to include pages via http or https depending on the protocol/scheme of the calling page 我需要通过httphttps包含页面,具体取决于调用页面的协议/方案

(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 ) (因此包括http://example.com/included如果我包括http://example.com/container,或包括https://example.com/included如果我包括HTTPS://示例.com / container

I just found that my problem was not with ESI Include . 我只是发现我的问题与ESI Include无关。

The inclusion can always be done via https and doesn't need to be adaptable to http or https ; 包含始终可以通过https完成,并且无需适应httphttps 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; 我的特定问题是与客户端相关的,因为包含代码中的资源(CSS,JS)是从容器中设置的<base href>中获取方案/协议的; so the cause was the latter one (that was always set to http ), not because of the ESI include . 因此原因是后者(始终设置为http ),而不是因为ESI include

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM