Forum Moderators: phranque

Message Too Old, No Replies

AddType application/x-httpd-php .js for a particular JS file

         

anjanesh

6:57 pm on Jan 6, 2009 (gmt 0)

10+ Year Member



In my js folder I want one particular file (common.js) to be parsed as php.
<Files common.js>
AddType application/x-httpd-php .js
</Files>

This works but I dont understand the need for ending .js.
Shouldnt AddType application/x-httpd-php alone work ?

Thanks

Caterham

7:32 pm on Jan 6, 2009 (gmt 0)

10+ Year Member



No, forcing a MIME-type for all files does ForceType but anyway -- setting a MIME-type is wrong since 1996, you're invoking a handler; use SetHandler instead

<Files common.js>
SetHandler application/x-httpd-php
</Files>