Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Following this question

http://serverfault.com/questions/186363/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?!

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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
share|improve this answer
    
I had those already in my .htaccess –  Florian Peschka Oct 12 '10 at 20:07
    
Does shtml work for including HTML files, without PHP in the game? –  AEP Oct 14 '10 at 16:27
add comment

SSI probably needs to be enabled.

share|improve this answer
    
I asked my provider and he assures me that it is enabled. –  Florian Peschka Oct 12 '10 at 20:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.