3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitHub PagesをEnterprise(OrganizationsでPrivate)で使ったら謎のドメインにリダイレクトされた話

Posted at

背景

社内ドキュメントをReactでホストする際に,GitHubのOrganizationsに参加しているユーザに限定して公開する目的でGitHub Pagesを使ったがeffective-pancakeのような謎のドメインにリダイレクトされてしまい,Reactアプリがうまく動作しなくなってしまった。


前提知識 GitHub PagesのPrivateモードについて

GitHub Pagesサイトの可視性を変更する


謎のURLにリダイレクトされる原因と解決策

  • 原因はOrganizationsでホストしているからではなく,privateで公開していること。

Private GitHub Pages redirects to internal url

これによるとGitHubによって発行される謎のドメインを使わないにはカスタムドメインを設定して使うしかないらしい。

  • Reactのアプリは通常のpublicリポジトリのように,package.jsonのhomepageをリポジトリ名を使うとうまくホストできなかったので,リダイレクト先に合わせてやったらうまく動いた。
  "homepage": "https://effective-pancake-hogehoge",
3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?