Azure Static Web App 404 Not Found

丞佑 鄭 0 信譽點數
2025-05-23T15:38:33.0833333+00:00

我有兩個專案,前端和後端分架在Azure Web App和Azure Static Web App上,為什麼Login專案沒有staticwebapp.config.app也能正常運行,但是ActivityHub專案卻會回報404: Not Found?
(I have two projects: the frontend and backend are hosted on Azure Web App and Azure Static Web App, respectively. Why does the Login project run normally without a staticwebapp.config.json file, while the ActivityHub project reports a 404: Not Found error?)

當我直接訪問ActivityHub專案的ActivityHome.vue時,因為沒有登入,所以會直接跳轉到Login專案的path: "/",也就是HomePage,這是有正確做到的,但是我如果從Login專案的UserLoby.vue,訪問ActivityHub專案的ActivityHome.vue,網址是對的:https://我的網域.azurestaticapps.net/activityhome?lang=zh-TW,但是會回報 404 Not Found,直接訪問比較沒有跳轉邏輯的測試頁面:https://我的網域.azurestaticapps.net/testpage,也是回報404 Not Found,是為什麼呢?
(When I directly access the ActivityHome.vue of the ActivityHub project, I get redirected to the Login project's path: "/", which is the HomePage, and this works correctly. However, if I access the ActivityHome.vue of the ActivityHub project from the UserLobby.vue of the Login project, the URL is correct: https://mydomain.azurestaticapps.net/activityhome?lang=zh-TW, but it returns a 404 Not Found error. Additionally, when I directly access a test page without any redirect logic at https://mydomain.azurestaticapps.net/testpage, it also returns a 404 Not Found error. Why is this happening?)

Azure
Azure

雲端運算平台和基礎結構,可透過 Microsoft 管理的資料中心全球網路來建置、部署和管理應用程式與服務。


您的回答

答案可由問題作者標示為「已接受」,而由仲裁者標示為「推薦」,這可協助使用者知道答案解決了作者的問題。