0

Following this question

HTAccess Directory Index with PHP-Files

I was able to create my index using a PHP file included in a SHTML file as follows

<!--#include virtual="/header.php" -->

This is written in the "header.shtml" which is declared as HeaderName in the .htaccess-file.

Now, this works perfectly fine on my local host (a MAMP-PRO), but when I upload it to my webspace, it won't work - The file is not included. When I check the source code, the directive written above to include the PHP is just written in plain text, so it seems it's not executed by the server.

Is there a flag I need to set to make this work? Or any workaround?!

2 Answers 2

1

The hoster must load mod_include. Also, someone (the hoster or you) has to configure it:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Also, either in .htaccess or in the < Directory > block matching your directory:

Options +Includes
2
  • I had those already in my .htaccess
    – F.P
    Oct 12, 2010 at 20:07
  • Does shtml work for including HTML files, without PHP in the game?
    – AEP
    Oct 14, 2010 at 16:27
1

SSI probably needs to be enabled.

1
  • I asked my provider and he assures me that it is enabled.
    – F.P
    Oct 12, 2010 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .