headless WordPress on Nuxt Hub
Hi, i created a NuxtHub project, and Headless WP site in Nuxt.
I want my custom domain to be maurodefalco.it for the nuxt site.
In the nuxthub admin page i need to enter the CNAME for use the custom domain, but in the Cpanel (where i have my wp site and i use the maurodefalco.it's domain) is impossibile to enter the CNAME for the entire domain, how can i achive this?
4 Replies
Hi @_maurodf. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I understand you're trying to set up a custom domain for your NuxtHub project while also having WordPress on the same domain. This is a common challenge when working with headless WordPress setups.
Based on the knowledge sources, NuxtHub does support custom domains, but there's a specific configuration needed. The issue you're facing is that you can't create a CNAME record for the apex domain (maurodefalco.it) in cPanel because DNS standards don't allow CNAME records for apex domains.
Here are a few potential solutions:
1. Use a subdomain: Instead of using the apex domain (maurodefalco.it), consider using a subdomain like www.maurodefalco.it or app.maurodefalco.it for your NuxtHub project. You can create a CNAME record for subdomains without issues.
2. DNS provider with ALIAS/ANAME support: Some DNS providers support ALIAS or ANAME records (sometimes called CNAME flattening), which work like CNAME records but can be used on apex domains. Check if your hosting provider offers this feature.
3. Proxy service: Services like Cloudflare can proxy your domain and allow you to effectively use a CNAME-like setup for apex domains.
For your specific setup with WordPress and NuxtHub:
1. Keep WordPress on a subdomain (e.g., wp.maurodefalco.it or admin.maurodefalco.it)
2. Set up your NuxtHub site on the main domain or another subdomain
3. Configure your Nuxt application to fetch data from your WordPress API
From the knowledge sources, I can see that Nuxt has good support for working with WordPress APIs. There's an example in the sources showing how to fetch WordPress posts:
You would need to update this to point to your WordPress installation's REST API endpoint.
Unfortunately, the knowledge sources don't contain specific information about NuxtHub's custom domain setup process. I recommend checking the NuxtHub documentation for more detailed instructions on their custom domain configuration.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@1004702547069644830> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
I have wordpress on subdomain wp.maurodefalco.it (still running)
Nuxthub on the main domain (maurodefalco.it)
You need to transfer your domain namespace to Cloudflare to use the Apex domain name on Nuxthub