0

I wrote a simple rest api few weeks ago, this api working good into my webserver (bitnami - localhost), and also to my pay hosting. Now I setup a webserver with the raspberry, I'm a linux newbie and I bought a raspberry for learn. Anyway, the webserver working perfectly but when I have uploaded my rest api I got:

The request Url /project/api/v1/user/getUsers was not found on this server
Apache/2.4.10 (Raspbian) Server at webserver Port 80

in this way I perform the request:

http://webserver/project/api/v1/user/getUsers

now this api shunk the request from index.php that load the properly php file by a router, in this case user.php -> getUsers (function)

this roles is available in the .htaccess that have this content:

RewriteEngine On

#basic roles

RewriteBase /api/v1/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#Shunk request on index.php 

RewriteRule ^(.+)$ index.php?uri=$1 [QSA,L]

now I guess that my webserver have a problem with this .htaccess, 'cause if I type this url:

http://webserver/project/api/v1/

I can see correctly the index.php response of:

Invalid Request

from my own rest api

any idea about this? Thanks.

Update

seems that the .htaccess is readed correctly but cannot found the index.php page, strange.

1 Answer 1

0

First, the content of RewriteBase should be:

RewriteBase /project/api/v1/

I would also suggest you to check your current setting of DocumentRoot to see if it is pointing to your www folder.

You can further check the link below as reference: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .