vps交流

Vercel 实现 URL 重定向


本帖最后由 iMacyh 于 2022-6-2 21:58 编辑

安装 Node.js
https://nodejs.org/

安装、登录 Vercel CLI

  1. npm i -g vercel
  2. #安装 Vercel CLI
  3. vercel login
  4. #登录 Vercel

复制代码

创建一个 json 文件,替换 example.com

  1. {
  2.   "redirects": [
  3.     {
  4.       "source": "/(.*)",
  5.       "destination": "https://example.com/$1"
  6.     }
  7.   ]
  8. }

复制代码

部署到 Vercel,下面替换成你的文件名(包括路径)

  1. vercel -A vercel.json –prod

复制代码

参考 https://hostloc.com/thread-777618-1-1.html

赞(0)
版权声明:本贴采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
帖子名称:《Vercel 实现 URL 重定向》
帖子链接:https://bbs.toot.su/125698.html

相关推荐