Reputation: 1102
I'm working on a PHP web app which will route every incoming request to the index.php same as WordPress or Joomla.
Following .htaccess is used to implement the feature.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
It is working on Wamp server [Windows] and IIS but when I migrate the app to the Ubuntu 16.04.02 [Apache 2.4.18, php7.0.18, Google Cloud Engine], it stops working for some custom extension file. It still working on normal php files thought.
I created a folder called service to put the web service php files and named the files as ****.svc.php and used with ****.svc url. It was working fine before but it is not on the Ubuntu and shown the following error.
Not Found
The requested URL /service/retrieve_opened_rs.svc was not found on this server.
Apache/2.4.18 (Ubuntu) Server at ******* Port 80
I believe this is the configuration issue but I still cannot figure out how to fix after 3 days. Please help me. Thanks in advance.
Upvotes: 2
Views: 71
Reputation: 6159
You probably have the Multiviews
option enabled. This never behaves well along with rewrite rules, especially with "double" extensions like .svc.php
Add this at the top of your .htaccess
file and that should take care of it:
Options -Multiviews
You might have to tweak your AllowOverride
directive (from the main Apache conf) if you don't have the rights to modify Options
from an .htaccess
file.
Upvotes: 3