Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anjali-251 opened this issue Feb 14, 2023 · 0 comments
Open

Comments

@anjali-251
Copy link

anjali-251 commented Feb 14, 2023

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?

@anjali-251 anjali-251 changed the title Api route is not working without index.php After changing api route path it is not working after deployed on vercel Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant