wamp ssi not working

2.6k Views Asked by At

i am working with wamp. i want to use ssi so i have changed following lines in httpd.conf but it does not seem to be working :

AddType text/html .shtml
AddHandler server-parsed .shtml
Options +Includes

test.html

<html>
<title>This is incl html</title>
<!--#include file="menu.shtml" -->
</html>

menu.shtml

<h1>hheelloo</h1>

What am i missing?

3

There are 3 best solutions below

0
On

I think this might work instead of < !--#include file:

<!--#include virtual="menu.shtml" -->

I also have this under my AddType text/html .shtml line:

AddOutputFilter INCLUDES .shtml

fyi I'm not an expert, I just looked at how my own server is set up. I hope it helps

0
On

Add to your projects root directory a .htaccess files with the following.

AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes
DirectoryIndex index.shtml index.html 

This should allow includes to work on that project.

0
On

I was experiencing this same problem until I found this link -

http://www.roseindia.net/tutorial/php/phpbasics/Setting-Up-SSI-On-Wamp.html

The gist of the answer is below. It seems the lines need to be added in a specific location within the file. They also suggested a find & replace on the FollowSymLinks option -

How to add SSI (Serverside include support in WAMP)?
Open http.conf file from <your drive):\wamp\bin\apache\Apache2.2.11\conf (e.g. C:\wamp\bin\apache\Apache2.2.11\conf)
Then add the following code:
AddType text/html .shtml
Options +Includes
AddOutputFilter INCLUDES .shtml
**The above code should be above "<Directory />" in httpd.conf file**
Then find "Options Indexes FollowSymLinks" and replace it with:
Options +Indexes +FollowSymLinks +Includes
Restart wamp and enjoy.

Following these steps worked for me.