aidvu / doner

Done List App
GNU General Public License v2.0
0 stars 1 forks source link

Without RewriteBase in .htaccess I get a 404 for the API #5

Open apokalyptik opened 9 years ago

apokalyptik commented 9 years ago

The requested URL[...]/public_html/api/index.php was not found on this server.

aidvu commented 9 years ago

Should be fixed now.

aidvu commented 9 years ago

Actually, can you tell me the setup you used for it? Server/Virtual Host? Or just cloned into an accessible directory?

apokalyptik commented 9 years ago

Sure. I git cloned the repo, and renamed the resulting doner directory to public_html for my virtualhost.

aidvu commented 9 years ago

Strange. I guess that's the default virtual host created by Apache?

aidvu commented 9 years ago

And my guess is that you fixed it with:

RewriteBase /api
aidvu commented 9 years ago

This should fix it. No RewriteBase, just set the API_PATH. https://github.com/aidvu/doner/commit/413d18e16c3fb148dede0027652ce63c9fba194d

apokalyptik commented 9 years ago
$ cat api/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

$ grep API api/config.php
define('API_PATH', '/api');

request: http://aidvu.test.apokalyptik.com/api/v1/dones

response: Status Code: 404 Not Found

The requested URL [...]/public_html/api/index.php was not found on this server.

( note: that file clearly is there... )

Still resolved by:

RewriteBase /api/

Unless I've done something wrong.