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