n350071のブログ

主にRubyなフリーランスエンジニア

GitHubPagesでリダイレクトが効くようにする

2019-08-29 n350071Git

🤔 状況

https://n350071.github.io へのアクセスを自分のブログに飛ばしたい。 なお、‘n350071.github.io’のリポジトリはこちら

👍 やり方

meta http-equiv="refresh" URL=で飛ばし先を指定し、
link rel="canonical" href=でこのページの本来のオリジナルを説明するとできるようです。
もしかすると、GitHubPagesだけでなく他のWebサイトでもできるかもしれないですね。

index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Redirecting to https://example.com/</title>
<meta http-equiv="refresh" content="0; URL=https://n350071.com">
<link rel="canonical" href="https://n350071.com">
_config.yml
theme: jekyll-theme-hacker

📚 参考

Setup a redirect on Github Pages - DEV Community 👩‍💻👨‍💻