Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does anyone know if it is possible to tell Apache to pass a specific file through the php parser ?

I want to try playing with "executable images", as described here (youtube).

I know about

AddType application/x-httpd-php .jpeg

Is it possible to do it only for a specific file, though ?

share|improve this question
1  
You can try putting this directive inside a specific directory directive. –  Khaled Feb 11 '11 at 13:41

2 Answers 2

up vote 1 down vote accepted

Just like this:

<Files exec.jpg>
    DefaultType application/x-httpd-php
</Files>
share|improve this answer

What if you did the detection via the php script? Say salty.jpg is the only one you want to redirect, everything else just load the jpg.

Use the above then use a php variable to detect the script name

if($_SERVER['SCRIPT_NAME'] == "salty.jpg"){
  <php code you want to run>
} else {
  <php code to load and display a jpg>
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.