Here's a Github repository of mine: https://github.com/n1k0/casperjs
There's a gh-pages
branch to hold the project documentation, which is basically the project website: https://github.com/n1k0/casperjs/tree/gh-pages
This branch setups the documentation site at http://n1k0.github.com/casperjs/ — hurray.
In the meanwhile, I've bough the casperjs.org
domain to get this website available through it, so I put a CNAME
file as recommended in the docs: https://github.com/n1k0/casperjs/blob/gh-pages/CNAME — in their example, the operation is supposed to create redirects from www.example.com and charlie.github.com to example.com…
While the website now points to http://casperjs.org/, there's no 301 redirect from http://n1k0.github.com/casperjs/ (the old site url) to the new domain name.
Any idea how to setup such a redirect, if it's even possible? Is it a bug? If it is, where should I open an issue?
In your local repo add the new repo at github as origin ( git remote add origin https://github.com/my_user/my_user.github.io ). Push local repo to the remote ( git push -u origin master ). Wait a few minutes until Github updates Pages — for the first push it usually takes 10-15 minutes.
A 301 redirect is a permanent redirect from one URL to another. While they can redirect site page URLs, they can also redirect from one domain to another.
Bringing this topic back from the dead to mention that GH now supports redirect-from's redirect-to parameter https://github.com/jekyll/jekyll-redirect-from#redirect-to
Simply add this to your _config.yml
gems: - jekyll-redirect-from
And this to the top of your index page.
--- redirect_to: "http://example.com" ---
To avoid the duplicate content, in a first time you can add a meta canonical like this:
<link rel="canonical" href="http://casperjs.org">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With