Laravel Api Routes Not Found on live server

Viewed 863

I am trying to deploy laravel apis on shared hosting. When I hit the api route it displays the error 404 not found. The routes are working fine on localhost but not found on live server

This is the htaccess file

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

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]
    RewriteRule ^ index.php [L]

</IfModule>

the api route should return json data

0 Answers
Related