Vercel 实现 URL 重定向

111次阅读

共计 322 个字符,预计需要花费 1 分钟才能阅读完成。

安装 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

网友回复:

注册 说实话这个有什么用

正文完