Closed vavra7 closed 5 years ago
Yes, I have the same question. 1) I tried using FileZilla in public_html just add WordPress files and gatsby build files. Result: Gatsby loads on startup, however, a couple of problems 1) Favicon icon doesn't show up, because trying to access it will give you WordPress theme 404 page 2) Trying to visit a non-existent link would bring you to WordPress theme 404 pages instead of gatsby.
2) Using FileZilla added WordPress files to the main domain. And using netlify launched front-end Gatsby. However, in order to launch it to your main domain, you have to change Nameservers in your domain providers. Which removes WordPress files. So now I have working front-end without WordPress. Website
So the only solutions I have come up is: 1) You can host wordpress on free wordpress.com account. It doesn't allow to use plugins, so it's pretty limited. Or maybe use cloud access free account. However, that doesn't sound like a good practice because it relies on the free account.
Similiar stack overflow question
There was also Netlify community answer which talked about redirecting.
Anyways, I would really like to find a way to host Gatsby and WordPress on the same domain.
Check out this guide for using Wordpress as a headless CMS, this guide on hosting on Netlify and the related links at the bottom of the page for further detail. That should answer your questions.
Based on nature of my question, very silly links. They definitely don't provide answer on my described issue.
@elken I'm not sure you understood the problem we are facing. Your first link is about sourcing from WordPress. On how to use get data from REST API to WordPress. Both of us already did that.
The second link is about deploying the site to netlify, again we already did that.
Our problem is: How to host Gatsby front-end preferably launched on Netlify. And Wordpress CMD on the same domain.
@ArnasDickus
Anyways, I would really like to find a way to host Gatsby and WordPress on the same domain.
It's impossible to host your Gatsby site and your WordPress site on the same domain, unless you're willing to configure the htaccess
file in your web hosting. But again, you'd lose all the perks of CI/CD (push to GitHub --> deploy).
@vavra7
I think the best pattern would be:
With this, yes, you do have to maintain 2 web hosting services, but:
Let me know if this answers your problems!
@alexluong
Then it is as I was afraid of. Many thanks for your answer.
Yes, thanks for the clarification. @alexluong It seems inconvenient to have 2 different domains. but it's still a lot better, compared to creating a custom WordPress theme.
It may seem like a hassle to have 2 different domain names, but it offers a lot of benefits. For one, the security aspect is way better, since people don’t know where your data is coming from.
I’d close the issue. Let me know if there is more questions.
Sorry, didn’t know this is part of the learning roadmap. I thought it was just a Q&A.
@alexluong I'm not certain how this ended up as part of the learning roadmap. But @vavra7, it seems like you got what you needed from this discussion? I'll re-close it, but if you'd like to open it back up, please let me know.
I am not sure if there's a better place to continue this discussion, but I was trying to find a way to do kind of the same thing as @vavra7 .
In theory, wouldn't there be a way to build your own C.D. process if you have both your CMS and Gatsby site on Node hosting? (Take WordPress out of the equation for now).
Roughly something like this:
1) Use NetlifyCMS or TinaCMS to edit content
2) Push saved updates to github with Node.
3) Detect the content update with github's webooks
4) Use the webhook to trigger a gatsby build
on the node server and regenerate the site
How is it possible make this working on custom hosting?
My case is that I have custom hosting and domain (https://www.wedos.com/webhosting). I run my site on Wordpress. Then I decided to use Wordpress only as headless CMS and develop frontend in Gatsby. My idea was that I use:
subdomain "www.admin.mysite.com" for Wordpress domain "www.mysite.com" for Gatsby
Originally I misunderstand how Netlify works and I thought that it can build and also deploy my Gatsby site from Github directly on my hosting which is not unfortunately true.
So there are two options now:
1) I can use my custom hosting with my domain for Wordpress only. Then I can use Netlify's hook for build Gatsby frontend from GitHub and let it deploy on Netlify's hosting.
BUT it means I must host Gatsby frontend on Netlify and also maintain another hosting for Wordpress. I don't like idea having two hosting because of single site and paying two domains.
2) Taky my original idea having subdomain for Wordpress and domain use for Gatsby.
BUT this means I have no option for automated process of deploying Gatsby after Wordpress content change. I don't like idea I have to manually and locally build forntend and then deploy it through FTP on my host every time I update something.
Is there any another option I am missing? Any Netlify alternatives? Other services or how does it commonly work?