NYCPHP Meetup

NYPHP.org

[nycphp-talk] htaccess/php question

Dan Cech dcech at phpwerx.net
Mon Oct 31 15:40:58 EST 2005


Jessica,

Unfortunately the Files directive only operates on the basename of the 
file, so in your case the directive would be:

<Files "test.htm">
   AddType application/x-httpd-php .htm
</Files>

You could also use the ForceType directive instead of AddType, like so:

<Files "test.htm">
   ForceType application/x-httpd-php
</Files>

This is probably the best way to do what you're after.

HTH

Dan

jessica kelly wrote:
> Hi All,
> 
> Trying to get a single .htm file in one directory parsed by PHP using htaccess in the directory. Powers that be won't let me use a .php extension. Can't seem to get it going. Don't want it parsing in lower directories.  This is what I have in the htaccess file in the folder I want the file to be parsed:
> 
> <Files "C:/apache/Apache/blablabla/test.htm">
> AddType application/x-httpd-php .htm .html 
> </Files>
> 
> This is what I have in the httpd.conf file:
> 
> <Directory C:/apache/Apache/blablabla/test.htm">
>      Options All
>      AllowOverride All
> </Directory>
> 
> Been googling & reading the htaccess manual but at a loss.
> 
> TIA,
> 
> Jessica




More information about the talk mailing list