I wrestled a bear once.
I wrestled a bear once.

Reputation: 23379

.htaccess php with .gif extension

I know I can write a php script and save it with an image ext. by adding the following to my .htaccess

AddType application/x-httpd-php .gif

But what if I only want files in a certain directory to be treated as such? How would I do that? I'm thinking about making a a footer for my email account, I would like to gather some basic non-intrusive data with it. Would this even work (assuming the client doesn't have images turned off)?

Upvotes: 0

Views: 2061

Answers (1)

user1781710
user1781710

Reputation:

<Files "/thisdirectory">
  AddType application/x-httpd-php .gif
</Files>

See here for Apache 2.4 docs.

http://httpd.apache.org/docs/current/mod/core.html

Upvotes: 1

Related Questions