LoginSignup
1
0

More than 5 years have passed since last update.

タイトルのそのまま

Netlify でのリダイレクト設定

ドキュメント
https://www.netlify.com/docs/redirects/

リダイレクトルールを書いた _redirects というファイルを置けばいいのだけど、ビルドコマンドを使ってるときは 公開用の ディレクトリに設置しないといけない。リポジトリのルートでは不十分で、ここにハマる。
どうも、_(アンダーバー)で始まるファイルはビルド時に公開用のディレクトリにコピーされない模様。

結論:明示すればいい

参照
https://github.com/thejameskyle/netlify-redirects/blob/master/_config.yml

_config.yml で以下のようにincludeでコピー(ビルド)するよう明示しておく。

_config.yml
include:
  - _redirects
1
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
1
0