所以我正在嘗試將我的 Hugo 博客部署到谷歌云應用引擎,但我遇到了 URL 映射問題,我玩了很多,但似乎沒有任何效果
主頁正在運行,我可以看到帖子,但是當我單擊帖子時出現錯誤:未找到訊息
應用程式.yaml
env: standard
runtime: nodejs16
service: default
handlers:
- url: /
static_files: public/index.html
upload: public/index.html
- url: /posts
static_dir: public/posts
- url: /(.*)
static_files: public/\1
upload: public/(.*)
檔案結構

網站鏈接:https ://www.waelfadlallah.com/
感謝NoCommandLine問題已解決,這就是我的 app.yaml 現在的樣子
env: standard
runtime: nodejs16
service: default
handlers:
- url: /posts/(. )/
static_files: public/posts/\1/index.html
upload: public/posts/(. )/index.html
- url: /assets
static_dir: public/assets
- url: /
static_files: public/index.html
upload: public/index.html
uj5u.com熱心網友回復:
看看這是否有效....
而不是使用static_dir,嘗試使用static_files并讓您的處理程式像這里的示例一樣。該示例具有(下面的示例)。看看你是否可以修改它以適應你的模式
- url: /([^\.] )([^/])
static_files: www/\1\2/index.html
upload: www/(. )
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/439029.html
