Reputation: 1449
I'm trying to deploy a small application to my remote server, however, I seem to be having difficulty with some of the routes. Bare in mind that everything works on my local machine.
Here is what I've done:
/home/user/app
/home/user/app/public
to /home/user/public_html/api
/home/user/public_html/api/index.php
from:$app->run();
to
$request = Illuminate\Http\Request::capture();
$app->run($request);
...this allowed my first route to work, but I cannot load any other routes such as:
http://www.mywebsite.com/api/v1/book
Please note that only http://www.mywebsite.com/api
is the only route that loads correctly.
My routes.php looks like this:
$app->get('/', function() use ($app) {
return "Lumen RESTful API";
});
$app->group(['prefix' => 'api/v1','namespace' => 'App\Http\Controllers'], function($app)
{
$app->get('book','BookController@index');
$app->get('book/{id}','BookController@getbook');
$app->post('book','BookController@createBook');
$app->put('book/{id}','BookController@updateBook');
$app->delete('book/{id}','BookController@deleteBook');
});
My .htaccess is as follows:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
The error I am receiving:
Let me know if you need any more information?
Any help would be greatly appreciated!
Upvotes: 1
Views: 1861