Why does not the web server find my route?

2

I uploaded a system in Laravel called android_api to the hostgator server, and I configured it in the public file.

To the main page it works, where it appears Laravel 5, but when I put the route that I created, it shows page not found.

I posted to the root of my server:

-> raiz
      |_ android_api
      |_ public_html
             |_ android_api (que é a pasta public)
                  |_ index.php

You can see here as Laravel finds normal, but if I put the route I created /listService , page not found.

My route looks like this:

Route::get('/listaService', "GeralController@getServices" );

It works locally.

I saw that I have to configure a Virtual Host there on the Hostgator server, but I did not find that location.

My .htaccess looks like this:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
    RewriteBase /android_api

    # 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]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
    
asked by anonymous 17.10.2017 / 23:36

1 answer

3

Currently your RewriteRule looks like this:

RewriteRule ^(.*)/$ /$1 [L,R=301]

As the index.php file mapped by the server as the default search and upload file is inside the public directory, so just make the following change:

RewriteRule ^(.*)/$ public/$1 [L,R=301]

For more information: link

    
18.10.2017 / 14:04