How can I use Jekyll with my domain, but hosted on GitHub?
Asked Answered
F

1

6

I would like to switch from WordPress to Jekyll. I already have migrated the articles (see new Jekyll articles + rendered page and old WordPress site).

Now I would like to have the old URLs:

Old URL        :      http://martin-thoma.com/word-error-rate-calculation/
Current new URL: http://martinthoma.github.io/word-error-rate-calculation/

So this question is really only about the top level domain. My provider (called "Knallhart") should only "hold" the domain martin-thoma.com (GitHub does not offer this, do they?) and GitHub should serve the content.

When a user enters http://martin-thoma.com/word-error-rate-calculation/ or http://martinthoma.github.io/word-error-rate-calculation/ the browser should show http://martin-thoma.com/word-error-rate-calculation/, although the content is at GitHub.

I know the GitHub page Setting up a custom domain with Pages, but I still don't understand what I should do.

I've tried adding a CNAME file with content martin-thoma.com to my GitHub repository, but this only lead to an redirect from martinthoma.github.io to martin-thoma.com. I've just tried adding a CNAME with content martinthoma.github.io on the webspace provided by Knallhart. This seems to have no effect.

I think I have to change something on GitHub as well as with Knallhart. GitHub has to know that it should display martin-thoma.com and Knallhart has to redirect to the content. But I don't understand how to do this. What do I have to change on GitHub and what do I have to do on side of my provider?

Can I do this by my own or do I need support from Knallhart? I currently have a quite cheap plan that basically only offers Hosting+PHP+MySQL. If I pay 6€ more, I get a Zone-Modul (which has the description "DNS controll for your domain"). Do I need a Zone-Modul?

Forsyth answered 1/1, 2014 at 10:24 Comment(0)
F
7

As the HELP PAGE said:

For a domain like example.com, you should use an A record pointing to 204.232.175.78:

In your case, you need to create an A record for martin-thoma.com, take mine as an example (I don't use Knallhart, maybe it's different, just make sure you make a A record to 204.232.175.78, which Github offers):

Host               |record type | host/IP  
*.kjuly.com         A             204.232.175.78 (Edit: NOT Recommended)  
@.kjuly.com         A             204.232.175.78  

Note: CNAME record is for subdomains like dev.martin-thoma.com.


EDIT (IMPORTANT):

Depend on the Github's official blog post "GitHub Pages Legacy IP Deprecation", the 204.232.175.78 is deprecated, you should use 192.30.252.153 or 192.30.252.154 instead.

Host               |record type | host/IP  
@.kjuly.com         A             192.30.252.153  
Fusco answered 1/1, 2014 at 10:37 Comment(6)
What is an A record and how do I create it? What about the Zone-Modul question?Forsyth
@moose you need to login your domain name's manage console on your Domain Name provider site ("Knallhart" as yours) to add this record. Generally speaking, there're 3 types of records at least: A, CNAME & MX. What you need it the A record. Just add it. If you cannot find it, you can contact your Domain Name Provider for help. ;)Fusco
@moose seems u do need that service called Zone-Modul, otherwise you cannot control your domain name's DNS. When you want to use Github to host your resource, you do not need Hosting+PHP+MySQL service anymore. What you need is only the domain name. Where did you registered the domain name? Knallhart? I recommend you to use http://godaddy.com or else. Or you can contact Knallhart for help if they can help you modify the DNS records. :)Fusco
Than you for your help. I've just talked with them and they changed ... something (free of charge :-) ). Now I get a 404 from GitHub when I enter http://martin-thoma.com/, but http://martinthoma.github.io/ does not return a 404. Do you know why? What can I try to find out what caused the error?Forsyth
@moose cool. You need to add a CNAME file (CNAME or A record are all use this file to tell Github your domain name) into your resource witch hosted on Github. You can take a look at mine (another site uses A record): github.com/Kjuly/kjuly.com/blob/gh-pages/CNAMEFusco
Thank you very much for your time. It works now as I expected it to work :-)Forsyth

© 2022 - 2024 — McMap. All rights reserved.