服务器端包含(SSI) - 基本 [英] Server Side Include (SSI) - Basic

查看:141
本文介绍了服务器端包含(SSI) - 基本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的生活中,我无法弄清楚如何让这些工作起作用。



我目前有一个名为included.html的文件,我希望在另一个页面上发布a.html。 included.html包含HTML和CSS。因此,在a.html中,我粘贴了以下代码:

 <! - #include file =included。 html - > 

没有用。
我联系了我的托管服务以确保他们支持SSI,他们表示他们只是以.shtml格式。



因此,我更改了文件名到included.shtml并将我的代码在a.html中更改为以下内容:

 <! - # include file =included.shtml - > 

仍然无效。我甚至会将#include文件改为#include virtual。不起作用。



任何和所有的帮助表示赞赏。谢谢。

解决方案

您的服务器主机在具有.shtml扩展名的页面中支持SSI。因此,您的 include 必须位于扩展名为.shtml的文件中,并且所包含的页面不一定需要相同的扩展名。


I, for the life of me, cannot figure out how to get these to work.

I currently have a file that is named "included.html" that I would like to be posted on another page, "a.html". The "included.html" contains both HTML and CSS. So within "a.html", I pasted the following code:

<!--#include file="included.html" -->

That did not work. I contacted my hosting service to make sure they supported SSI and they said they did, just in the .shtml format.

So, I changed the file name to "included.shtml" and changed my code within "a.html" to the following:

<!--#include file="included.shtml" -->

Still does not work. I've even messed around with changing #include file to #include virtual. Doesn't work.

Any and all help is appreciated. Thanks.

解决方案

Your server host is supporting SSI in pages that have the .shtml extension. Therefore, your include must be in a file with a .shtml extension, and the pages being included don't necessarily need the same extensions.

这篇关于服务器端包含(SSI) - 基本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆