简体   繁体   English

HTML SSI在浏览器中不起作用

[英]HTML SSI's don't work in browser

I'm trying to use server side includes for both my header and navigation, as they will be constant across every page, and I'd like the ability to make frequent changes in one place and have them populate across all pages. 我试图将服务器端包含项用于标题和导航,因为它们在每个页面中都将保持不变,并且我希望能够在一个位置进行频繁更改并使其填充到所有页面中。 I have tried a "file" and "virtual" include, and have tired placing the include files in the same directory. 我尝试了“文件”和“虚拟”包含,并且已经厌倦了将包含文件放在同一目录中。 The include files have no duplicate code (doctype indicator, html tag, etc). 包含文件没有重复的代码(文档类型指示符,html标记等)。 I've also tried both .html and .shtml file extensions. 我还尝试了.html和.shtml文件扩展名。 I use the file explorer in DW to select the files, so I'm assuming the path is correct. 我在DW中使用文件资源管理器来选择文件,因此我假设路径正确。

The SSI's preview fine in Dreamweaver, but will not populate in the browser. 在Dreamweaver中SSI的预览很好,但是不会在浏览器中填充。 Any suggestions would be greatly appreciated. 任何建议将不胜感激。

    <!--#include virtual="/lpapp/includes/influencer_header.shtml" -->       
    <!--#include virtual="/lpapp/includes/influencer_sidebar.shtml" -->

Dreamweaver probably support SSI. Dreamweaver可能支持SSI。 If you run your html from a random folder on your local PC, SSI won't work. 如果您从本地PC上的随机文件夹运行html,则SSI将无法运行。 As soon as you upload the project to a Apache webserver or a virtual server like Wamp/Mamp. 一旦将项目上载到Apache Web服务器或Wamp / Mamp之类的虚拟服务器。 It is possible to get SSI working using the right SSI syntax and .htaccess. 使用正确的SSI语法和.htaccess,可以使SSI工作。

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

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