rsokl / Learning_Python

Source material for Python Like You Mean it
https://www.pythonlikeyoumeanit.com/
Other
165 stars 54 forks source link

Adding links to Chinese version #106

Closed alexander-ding closed 4 years ago

alexander-ding commented 4 years ago

The Chinese translation of the site is currently hosted on https://alexding123.github.io/Learning_Python/. It'd be great if you could add a permanent redirect (without path redirect) on your domain's synthetic record slot from subdomain cn to this link so that the site can be viewed on https://cn.pythonlikeyoumeanit.com. #102 provides a preliminary pull request to add the cross-link to the Chinese site's URL, though it requires you to generate the HTML on your site on the branch push the results before merging (my computer generate slightly different HTML and .doctree files that would screw up the commit history).

rsokl commented 4 years ago

I registered the permanent redirect - I did not enable SSL because I am not sure what goes into generating the requisite certificate. http://cn.pythonlikeyoumeanit.com does successfully redirect though!

rsokl commented 4 years ago

It looks like the redirect is no longer working... I am not sure what is going on.

image

This seems like it should work

alexander-ding commented 4 years ago

I did some testing. Seems like the redirect works when you try to access cn.pythonlikeyoumeanit.com or http://cn.pythonlikeyoumeanit.com, but not the https version, possibly because you didn’t enable SSL on this. It seems like the path on the browser changes though—my ideal situation is for the link to stay as cn.pythonlikeyoumeanit.com after redirecting. Let me do some more tests. Just to be sure, are you using google domains? The interface looks different.

rsokl commented 4 years ago

I am using google domains. I am no longer able to get any permutation of those redirects (http or otherwise) to work anymore. Nor can David some others reach it.

rsokl commented 4 years ago

I think I have to set it up via cloudflare

alexander-ding commented 4 years ago

As soon as I get home, I’ll play around. Sorry that this doesn’t work out: I was somehow able to get it working perfectly on google domains in a test.

rsokl commented 4 years ago

So it looks like the issue is, on cloudflare, that I have to point the CNAME right to your domain (alexding123.github.io), not the specific Learning_Python url, but this points to your actual homepage.

rsokl commented 4 years ago

I am temporarily linking directly to your github

alexander-ding commented 4 years ago

Yeah, I read the same thing here. Setting up a cname to directly link your cn subdomain to my alexding123.github.io seems to be the thing to do. Now if I set up my repo to link to this cn.pythonlikeyoumeanit.com subdomain everything should work out.

alexander-ding commented 4 years ago

I changed my repo's CNAME file to point to the subdomain. When the DNS propagates, I think this should work not. Do note that I'm enforcing HTTPS.

Also, thank you for doing this! Sorry that this took so long.

rsokl commented 4 years ago

Okay I will loop back to this when the DNS propagates. And no worries! It is well-worth the work :)

(I accidentally pointed google to the wrong nameservers as I was messing with things, so I created far more work for myself in fixing that than this process did)

rsokl commented 4 years ago

Wait... are you having your github page redirect to cn.pythonlikeyoumeanit.com? Now my link to your github page redirects to that subdomain, which doesn't exist

alexander-ding commented 4 years ago

According to the accepted answer of this thread, this should be the expected behavior, and as soon as your DNS record is propagated things should work.

rsokl commented 4 years ago

Oh hey, I think it works! http://cn.pythonlikeyoumeanit.com/