Guillaume Chevalier
Guillaume Chevalier

Reputation: 10888

How to host Jekyll and static HTML sites under a slash of a Flask Jinja2 site?

Okay, what I want to do seems simple but isn't. Here is what I have and want:

  1. A website created with Flask and Jinja 2: https://www.neuraxio.com/
  2. A documentation website for an open-source library created with sphinx. The output is raw static HTML files: https://www.neuraxle.neuraxio.com/stable/index.html However, I would like to move this website to https://www.neuraxio.com/neuraxle/stable/index.html with redirects from the old subdomain to the new one. The static HTML site is hosted with github pages for now.
  3. I want to create a jekyll blog with github pages because it's simple to manage and create new articles from markdown. Or perhaps a Wordpress blog, but something. I'd like to host that blog under https://www.neuraxio.com/blog/ and not under https://www.blog.neuraxio.com/

I know subdomains are easy to manage from a DNS and hosting standpoint, but I'd like to centralize everything under the same subdomain: www.neuraxio.com.

So, how would you approach solving this problem?

For the static HTML of part 2, it might be as simple as moving the static HTML to a subfolder of the public static HTML of the Jinja 2 theme, except the fact that it might break relative links (?).

For the Jekyll or Wordpress site, I'd like it hosted under a slash of the domain and not a subdomain. How would you approach that?

Thank you for suggesting fixes and various creative ways to approach the problem. If that can be solved simply with the existing Flask and Jinja 2 code, that'd be cool. Or by using strange DNS tricks considering I'm already set up with the hosting of each subsites.

I expect to have relative HTML links errors, however. How should I prepare agains that, too, or automatically fix each link?

Upvotes: 1

Views: 756

Answers (1)

Taha Mahjoubi
Taha Mahjoubi

Reputation: 402

I suggest adding a CNAME dns record that can point https://www.neuraxle.neuraxio.com/stable/index.html to https://www.neuraxio.com/neuraxle/stable/index.html

This is pretty easy to do thats why I would have just gave you a link if I could but I will write a long answer instead :

1 - Log in to your DNS management service (GoDaddy.com, googlecloud dns service...) For my part, my website is hosted on google cloud DNS.

2- Click on your website.

3- Select Add a Record Set

4- Select CNAME record

5- I the DNS name form add https://www.neuraxle.neuraxio.com/

6- In the canonical name (the alias) add : https://www.neuraxio.com/neuraxle/

I wouldnt put this part /stable/index.html because your server should be abble to take care of pointing to it.

Hope this helps !

Upvotes: 2

Related Questions