域名不会重定向到用gatsby编写的github上托管的网站的子域名称



我有一个用盖茨比编写并托管在github上的网站。ragith.com不会重定向到www.ragith.com。

对于一些人来说,ragith.com为其他人工作,它将他们引导到带有广告的通用页面。我使用domain.com作为域名。

我请我的朋友去参观过一次,但没有成功。我请他再次来访,结果成功了。我不知道为什么这个网站有时能工作,其他时候却不能工作。

听起来HTTP重定向没有得到正确处理。

您可以在index.html的元标签中实现github页面上的重定向。这个答案告诉您如何以及如何考虑

<!DOCTYPE html>
<meta charset="utf-8">
<title>Redirecting to www.ragith.com</title>
<meta http-equiv="refresh" content="0; URL=https://www.ragith.com">
<link rel="canonical" href="https://www.ragith.com">

关于构建你的网站和盖茨比,你可以用react头盔设置元标签。盖茨比医生告诉你如何:

import React from "react"
import { Helmet } from "react-helmet"
class Application extends React.Component {
render() {
return (
<div className="application">
<Helmet>
<meta charSet="utf-8" />
<title>My Title</title>
<link rel="canonical" href="https://www.ragith.com" />
</Helmet>
</div>
)
}
}

最新更新