Ubuntu Server: Apache2 seems to attach .php to URI

Solution 1:

The issue is the default Apache configuration on Ubuntu:

Options Indexes FollowSymLinks MultiViews

MultiViews is changing request_uri from myResource to myResource.php.

Solutions:

  • disable MultiViews in .htaccess: Options -MultiViews
  • remove MultiViews from default config
  • rename the file as example to myResourceClass

I chose last option because that should work regardless of configuration and I only have 3 such files so the change took about 30 secs...