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

Đang mở
#116 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
api, backend, cloud

Hướng nghiên cứu

Start with the RouteServiceProvider route group, routes/api.php, and the shown .htaccess rules, then check how this PHP example is configured for Vercel deployment. Reproduce the deployed request with and without index.php and determine what configuration or rewrite behavior causes the 404. Done means the /api/... route works on Vercel without index.php.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
PHP
Star
357
Fork
149
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của contributte/vercel-examples

Tất cả issue của contributte/vercel-examples

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.