Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best approach for redirection of old pages in Jekyll and GitHub Pages?

I have blog on github pages - jekyll

What is the best way to solve url strategy migration?

I found the best practice in common is create htaccess like so

Redirect 301 /programovani/2010/04/git-co-to-je-a-co-s-tim/ /2010/04/05/git-co-to-je-a-co-s-tim.html 

But it does not seems to work with Github. Another solution i found is create rake task, which will generate redirection pages. But since it's an html, it's not able to send 301 head, so SE crawlers will not recognize it as an redirection.

like image 331
Mailo Světel Avatar asked Apr 16 '12 16:04

Mailo Světel


People also ask

Which redirect is best?

A 301 redirect is a permanent redirect that passes full link equity (ranking power) to the redirected page. 301 refers to the HTTP status code for this type of redirect. In most instances, the 301 redirect is the best method for implementing redirects on a website.


1 Answers

The best solution is to use both <meta http-equiv="refresh" and <link rel="canonical" href=

It works very well, Google Bot reindexed my entire website under new links without losing positions. Also the users are redirected to the new posts right away.

<meta http-equiv="refresh" content="0; url=http://konradpodgorski.com/blog/2013/10/21/how-i-migrated-my-blog-from-wordpress-to-octopress/"> <link rel="canonical" href="http://konradpodgorski.com/blog/2013/10/21/how-i-migrated-my-blog-from-wordpress-to-octopress/" /> 

Using <meta http-equiv="refresh" will redirect each visitor to the new post. As for Google Bot, it treats <link rel="canonical" href= as 301 redirect, the effect is that you get your pages reindexed and that is what you want.

I described whole process how I moved my blog from Wordpress to Octopress here. http://konradpodgorski.com/blog/2013/10/21/how-i-migrated-my-blog-from-wordpress-to-octopress/#redirect-301-on-github-pages

like image 128
Konrad Podgórski Avatar answered Nov 07 '22 14:11

Konrad Podgórski