Apache Server-Side Includes Refuse to Work (Tried everything in the docs but still no joy)
Posted
by
raindog308
on Pro Webmasters
See other posts from Pro Webmasters
or by raindog308
Published on 2012-04-22T02:11:15Z
Indexed on
2012/05/30
22:51 UTC
Read the original article
Hit count: 430
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...
© Pro Webmasters or respective owner