0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Next.js】Firebaseホスティングでドメイン変更時のリダイレクト設定

Posted at

最近サイトのドメインを変更しました。
その際、元のサイトから新しいサイトへリダイレクトするように設定したのでその時の備忘録を残しておきます。

設定方法

設定はとっても簡単です。

firebase.jsonファイル内のredirectsに、以下のように記述するだけです。

{
  "hosting": {
    "site": "hogehoge",
    "public": "out",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "redirects": [
      {
        "source": "/:path*",
        "destination": "https://hogehoge.com/:path",
        "type": 301
      },
      {
        "source": "/",
        "destination": "https://hogehoge.com/",
        "type": 301
      }
    ]
  }
}


以上!Firebaseでよかった!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?