juicyfx / vercel-examples

📦 Example projects using Vercel platform. Using Node.js, PHP and others.
https://f3l1x.io
MIT License
318 stars 150 forks source link

After changing api route path it is not working after deployed on vercel #116

Open anjali-251 opened 1 year ago

anjali-251 commented 1 year ago

Bug report

I have server like "api.xxx.dev/backend/..." I have changed prefix backend to api New path is "api.xxx.dev/api/.."

It is not working on development server getting 404 response code but If I am using "api.xxx.dev/index.php/api/.." It is working on server

and I need to remove index.php from url

My Routeserviceprovide is

Route::middleware('api') ->prefix('api') ->namespace($this->namespace) ->group(base_path('routes/api.php'));

And my .htaccess file is

Options -MultiViews -Indexes 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] # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^index.php/(.+) /$1 [R=301,L]

Is there any required thing to do on vercel?