SSI IF语句错误 [英] SSI IF Statement error

查看:84
本文介绍了SSI IF语句错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用SSI的if语句时遇到麻烦.我已经在两台计算机上重新安装了操作系统(一台是win7,另一台是win8 ),并在它们上安装了 WAMP .然后,我将旧项目放在文件夹中.打开以下项目后,如果出现以下错误消息,我正在使用SSI:

I am having troubles with the if statement of SSI. I have reinstalled OSes on two computers (one with win7, the other with win8) and installed WAMP on them. Then I have put my old projects in the folder. After I have opened the project where I'm using SSI if I get the following error message:

[处理此指令时发生错误]

问题是,当我在工作中和笔记本电脑中打开这些文件时,不会出现此错误.

The problem is that when I open those files at work and my laptop I do not get this error missing.

此后,我切换到 XAMPP ,但再次遇到相同的错误.

After that I have switched to XAMPP, but get the same error again.

我正在使用以下语句:

<!--#if expr="$DOCUMENT_NAME = home.html"-->
<body class="home">
<!--#else-->
<body>
<!--#endif-->

似乎输入了if语句,因为它放置了正文类".home",然后出现了消息.

And it seems to enter the if statement, because it puts the body class ".home", and after that comes the message.

其他所有内容,但if语句有效.我已经分离了header.shtml和footer.shtml,并且ssi将它们加载到了站点中.但是当我使用if时,它会中断.

Everything else, but the if statement works. I have separated my header.shtml and footer.shtml and the ssi loads them in the site. But when I use if - it breakes.

我不认为这是相关的,但万一-这就是我的.htaccess文件的样子:

I don't think it is related, but in case - this how my .htaccess file looks like:

Options +Includes
AddHandler server-parsed .shtml .html .htm

推荐答案

SSILegacyExprParser on 添加到您的.htaccess

Add SSILegacyExprParser on to your .htaccess

请参见链接.

这篇关于SSI IF语句错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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