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?!

F.P
  • 143
  • 4
  • 15

2 Answers2

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
AEP
  • 432
  • 2
  • 4
1

SSI probably needs to be enabled.

Ignacio Vazquez-Abrams
  • 45,019
  • 5
  • 78
  • 84