Server Side Include on S3

别来无恙 提交于 2019-12-22 08:57:59

问题


Amazon S3 has static website hosting, but does not support tags like:

<!--#include virtual="i/header.htm" -->
<!--#echo var="i/header.htm" -->
<!--#include file="i/header.htm" -->

Is there anyway to mimic this functionality without having some sort of JavaScript/AJAX content request for the header on every page on S3?


回答1:


You could use javascript to assemble the page in the client browser. With jQuery:

$('#header').load('header.html');

This has a serious SEO drawback-- search engines like Google won't see the final page.

You could also embed content in the page as an iframe.




回答2:


Amazon S3 provides flat file storage. Whatever logic you apply needs to be client-side.



来源:https://stackoverflow.com/questions/6776359/server-side-include-on-s3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!