Github网站托管,处理不正确的子页面

时间:2015-07-14 05:26:02

标签: url github github-pages

我在github上托管了一个简单的单页HTML / CSS网站。我想重定向不正确的子页面(即mysite.com/m)重定向到主页(mysite.com)作为默认路由。这可以在github上的静态站点上实现吗?

1 个答案:

答案 0 :(得分:0)

您可以创建一个包含以下内容的/m/index.html文件:

<!DOCTYPE html>
<meta charset=utf-8>
<title>Redirecting...</title>
<link rel=canonical href="/index.html">
<meta http-equiv=refresh content="0; url=/index.html">
<h1>Redirecting...</h1>
<a href="/index.html">Click here if you are not redirected.</a>
<script>location='/index.html'</script>
相关问题