Reputation: 11
I have github pages site. For example mysite.github.io. When I open www.mysite.github.io it doesn't work. I want both of them to work.
Is it possible to redirect www.mysite.github.io to mysite.github.io?
[EDIT]
I use free github account.
For more information read About GitHub Pages >> Types of GitHub Pages sites.
Upvotes: 1
Views: 268
Reputation: 1070
What @daman-arora said is correct, that to redirect to mysite.com
from www.mysite.com
,but at first you will need to buy a custom domain.
But I want to say that you still can redirect from www.mysite.github.io
to mysite.github.io
by this simple trick:
www.mysite.github.io
.index.html
file.<meta http-equiv="refresh" content="0; url=https://mysite.github.io">
Problems of redirection:
<a href="https://mysite.github.io">Please click here if you are not redirected</a>
" to your page, so that users can click on the link and can go to the site, if not redirected automatically.Upvotes: 0
Reputation: 2267
Well, to the best of my knowledge, that's not possible. Only github can do that if they want to. I don't think that it's in our hand to make this redirect. It simply throws a 404.
Instead of doing this, consider buying a custom domain from a domain registrar. After that, you'll probably be able to redirect from www.example.com to example.com
You can go for godaddy, hostgator or any other domain registrar if you want to buy a domain for your project.
Upvotes: 3