Mobile app version of vmapp.org
Login or Join
Angie530

: Apache Server-Side Includes Refuse to Work (Tried everything in the docs but still no joy) Trying to get apache server-side includes to work. Really simple - just want to include a footer

@Angie530

Posted in: #Apache

Trying to get apache server-side includes to work. Really simple - just want to include a footer on each page.

Apache 2.2:

# ./httpd -v
Server version: Apache/2.2.21 (Unix)
Server built: Dec 4 2011 18:24:53
Cpanel::Easy::Apache v3.7.2 rev9999


mod_include is compiled in:

# /usr/local/apache/bin/httpd -l | grep mod_include
mod_include.c


And it's in httpd.conf:

# grep shtml httpd.conf
AddType text/html .shtml
DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html
AddHandler server-parsed .shtml
AddType text/html .shtml


In the web directory I created a .htaccess with

Options +Includes


And then in the document, I have:

<h1>next should be the include</h1>
<!--#include virtual="/footer.html" -->
<h1>include done</h1>


And I see nothing in between those headers. Tried file=, also with/without absolute path.

Is there something else I'm missing?

I see the same thing on another unrelated server (more or less stock CentOS 6), so I suspect the problem is between keyboard and chair...

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angie530

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

From my WampDeveloper (Wamp package) configuration:

<IfModule include_module>
<Directory "C:/WampDeveloper/Websites/*/webroot">
Options +Includes
AddOutputFilter INCLUDES .html .shtml
</Directory>
</IfModule>


You probably are missing the AddOutputFilter directive that assigns file extensions to be processed by the SSI filter or are using an incorrect AddHandler filter-name.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme