1

I'm currently trying to fancy up my directory index a little - To do so, I already managed to create a decent layout around the created table - But now, I need to add some scripting, too.

As I'm most familiar with PHP, I figured I could just replace the

HeaderName /meta/header.shtml

with

HeaderName /meta/header.php

But this results in the file not being included at all. I created a workaround to still work with PHP by adding a SSI to header.shtml, so the file's only content is

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

And then doing all HTML output and PHP scripting in the header.php. Although this works exactly how it should, it still fells wrong. How can I get my PHP-File to be directly included without the SHTML in between?

F.P
  • 143
  • 4
  • 15
  • To me, that is a perfect hack. Another ways is to use "AddType text/html .php" and "AddHandler application/x-httpd-php .php" but i am not aware of the security implications this could have. – Torian Sep 30 '10 at 21:18

1 Answers1

2

After a little research on this, you can set this like this:

HeaderName /path/to/header.php
ReadmeName /path/to/footer.php
AddType text/html .php
Addhandler application/x-httpd-php .php
<Directory /path/to/indexedDir>
  Options Indexes
</Directory>

And that should do it, no security implications (from my comment above).

Torian
  • 2,314
  • 18
  • 10