香雨站

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 79|回复: 0

域名绑定到 Github Pages 后怎么做 301 跳转

[复制链接]

1

主题

2

帖子

4

积分

新手上路

Rank: 1

积分
4
发表于 2023-3-26 18:17:47 | 显示全部楼层 |阅读模式
大概是要从 /index.php/post-xxx.html 跳转到 /post-xxx.html,Jekyll 可以 301 吗
——刚想问就看到了这个:https://github.com/jekyll/jekyll-redirect-from,不过还是水一贴 (ಡωಡ)
<hr/>首先:
gem install jekyll-redirect-from然后在 _config.yml 添加:
plugins:   - jekyll-redirect-from在文章可以:
redirect_from: /index.php/post-xxx.html不过是在 /_site/index.php/post-xxx.html 下这样跳转的:
<!DOCTYPE html>
<html lang="en-US">
  <meta charset="utf-8">
  <title>Redirecting…</title>
  <link rel="canonical" href="http://localhost:4000/post-xxx.html">
  <script>location="http://localhost:4000/post-xxx.html"</script>
  <meta http-equiv="refresh" content="0; url=http://localhost:4000/post-xxx.html">
  <meta name="robots" content="noindex">
  <h1>Redirecting…</h1>
  <a href="http://localhost:4000/post-xxx.html">Click here if you are not redirected.</a>
</html>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|香雨站

GMT+8, 2025-3-17 13:52 , Processed in 0.082937 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.. 技术支持 by 巅峰设计

快速回复 返回顶部 返回列表