I'm using the php library tonic for web services. My resource is as example at
base-uri/myResource
Now if a file myResource.php exists in that directory, the url mod_rewrite gets to see is
base-uri/myResource.php
which then fails the rewrite conditions and my application breaks (app works on apache on windows)
If I rename myResource.php to my myResourceClass.php (or anything else), it works.
So it seem that apache or one if its modules assumes that with base-uri/myResource I want to call base-uri/myResource.php but only if myResource.php exists.
Is this a general issue or can I somewhere configure this to not happen?
thanks!
EDIT:
see
How to set up a basic mod_rewrite?
The answer contains the same observation!
ANSWER:
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...