I'm writing a RESTful API for my web service.
I want all the calls of the following pattern trigger a php file that is that is located in /myserver/api/controller.php
The pattern is :
http:/www.mydomain.com/api/user
http:/www.mydomain.com/api/resource
Temel olarak, http://www.mydomain.com/api/ * tetiklemesi / API / controller.php için tüm çağrılar
. Şu anda, benim htaccess in / API ve bu gibi görünüyor:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . controller.php
UPDATE 1:
The .htaccess in the parent directory is:
RewriteEngine On
RewriteCond %{HTTP_HOST} !:9000$
RewriteCond %{SCRIPT_FILENAME} \.php$ [OR]
RewriteCond %{REQUEST_URI} ^$
RewriteRule ^(.*)$ http://%{HTTP_HOST}:9000/$1 [P,L]
RedirectMatch 301 /jobs$ http://someurl
RedirectMatch 301 /support/$ http://someurl
RedirectMatch 301 /jobs$ http://someurl
RedirectMatch 301 /someurlA http://someurlB
Ben nasıl. Htaccess dosyası yazmak gerekir?
Teşekkürler!