tags:

views:

102

answers:

2

by default apache will load php interpreter with .php extension. Somep\how php interpreter also called with this kind of extension .php.fr . How to disable this language extension?

A: 

Hi,

you can setup the extensions interpreted by Apache on 2 Places.

  1. httpd.conf

    AddType application/x-httpd-php .phpx

Will load .phpx files as PHP Scripts

  1. mime.type

    application/x-httpd-php phpx

ArneRie
(a) AddType can be in any apache config file, and there are normally many. (b) There isn't going to be an AddType for .php.fr. See http://httpd.apache.org/docs/2.0/mod/mod_mime.html and http://httpd.apache.org/docs/2.0/mod/mod_negotiation.html
derobert
+1  A: 

The .fr is being interpreted as French during content negotiation by Apache. This is probably because you have Options +MultiViews and MultiviewsMatch Handlers are both set. Getting rid of either should stop .php.fr from working, but changing this may break other pages. (Assumably, you enabled both for a reason). Also, I'm not completely sure if MultiVideosMatch applies to PHP, but Options +MultiViews definitely does.

If you're trying to make sure people can't upload PHP files and have your webserver execute them, instead of just blacklisting extensions, use php_admin_flag engine off to turn off PHP in that location:

<Location /uploads>
    php_admin_flag engine off
</Location>
derobert
i tried to remove MultiViews , still no effects and i dont have MultiviewMatch configured. Calling directly in url file.php.fr will eventually execute the php file. For certain reason disabling php engine is not an option for me. Any idea?
Abu Aqil
Did you actually try `Options -MultiViews` to make sure it is off?
derobert