1

I noticed on Rackspace, when using an Ubuntu instance (10.04; standard LAMP setup), the ".php" suffix on a URL is optional. ie www.example.com/thispage loads thispage.php

When I setup a very similar server on Amazon (default AWS 32-bit ami; a flavor of CentOS/Red Hat) and locally on osX 10.6, the ".php" suffix is required. www.example.com/thispage returns a 404 error, while /thispage.php loads the file as expected.

The most likely cause, in my mind at least, is that there are different default settings in php.ini or the Apache configuration between these different setups, but I can't figure out what it is. Can anyone explain to me where this difference comes from?

NOTE: I know this can be overcome using mod_rewrite, I'm just curious as to this difference in the default configurations.

west1737
  • 377
  • 1
  • 4
  • 14
  • 1
    possible duplicate of [hide .php extension - htaccess](http://stackoverflow.com/questions/8371634/hide-php-extension-htaccess) – mario Jan 28 '12 at 11:51

2 Answers2

2

Check if the MultViews-Option is set.

If it does, and there is no directory like this(e.g. "thispage") , the server will look for files with the filename "thispage" and any extension and deliver(if any found) the best match.

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
0

the answer is this http://www.php.net/manual/en/security.hiding.php#45896 , but you're going to need to access httpd.conf file

machineaddict
  • 3,216
  • 8
  • 37
  • 61