faqts : Computers : Programming : Languages : PHP : Common Problems : Tips and Tricks

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 9 people (78%) answered Yes
Recently 5 of 7 people (71%) answered Yes

Entry

can apache be configured to pass a single .htm file to PHP for decoding rather than EVERY .htm file or NO .htm files

Dec 9th, 2002 12:51
Jens Clasen, Stevie Vincent,


There are two solutions to force apache to parse certain files using PHP::
1) If You want to parse only one special file (e.g. index.html) put this
   snippet into a .htaccess-file:
   <Files index.html>
       ForceType application/x-httpd-php
   </Files>
   As soon as this Content-type is assigned to PHP in httpd.conf 
   index.html would be parsed by PHP.
2) If You want to parse a certain group of files (e.g. all files starting 
   with "php_") try this snippet:
   <FilesMatch "^php_">
       ForceType application/x-httpd-php
   </FilesMatch>
   (FilesMatch's parameter is a regular expression)