How can I deploy to Vercel correctly with a custom domain in de-coupled mode & allow for wp-admin?

Hi all,

I have made various deployments to Vercel with the current Frontity website with 0 issues (using a generated domain).

The current Wordpress installation (where the REST API is served from) is hosted on a separate server, ie decoupled mode.

My questions are:

  1. How do I make sure that when we go to domain.com/wp-admin, the wp-admin panel will appear? Do I create some kind of redirect route in Frontity?
  2. What domain should the wordpress installation have, that the Frontity App hosted on Vercel will point to? Do I set this to a subdomain? What strategy should I use / what have you guys done?

I plan on migrating tomorrow to a full deployment (i.e under the official domain name) so any tips and pointers will be much appreciated!

Hey jamesjappy,

Glad to hear you already made progress. Let me try to directly answer your questions.

  1. How do I make sure that when we go to domain.com/wp-admin, the wp-admin panel will appear? Do I create some kind of redirect route in Frontity?

As far as I know, that shouldn’t be really possible as your frontend(Frontity) is running completely detached from WP.

  1. What domain should the wordpress installation have, that the Frontity App hosted on Vercel will point to? Do I set this to a subdomain? What strategy should I use / what have you guys done?

What we do is that we place Wordpress on a subdomain(api.example.com) and the site on example.com. Then you can make a 301 redirect from example.com/wp-admin to api.example.com. This is of course not required, just an idea to make it easier to access the CMS.

Another idea could be that you manage your WP within a folder rather than a subdomain(haven’t done that personally). I am not sure if that could cause some issues with Frontity routing if for example you have example.com/wp/wp-admin.php.

Hope that helps.

1 Like

Awesome thank you, I think I understand a bit better now.

Just to clarify:

So I will migrate the domain name to Vercel. Set the sub-domain on the Wordpress installation, i.e api.domain.com (making sure that’s correctly pointing to the wordpress website on the server) & simply reference api.domain.com from my Frontity installation on Vercel.

And to access the wp-admin, simply type api.domain.com/wp-admin (or 301 redirect on domain.com/wp-admin for convenience).

Thanks again, I will try tomorrow & report back :slight_smile:

@jamesjappy Have you checked the Embedded Mode in Frontity?

Via a WordPress plugin you can make your WordPress site your primary domain while having Frontity in charge of rendering your site. In this way you can continue taking advantage of the features that were already working with your WordPress site (including the transparent access to the wp-admin dashboard)

Hey @juanma,

thanks for sharing this. I was not aware of embedded more but will definitely take a look as we are building a webshop and seo is super important. Hopefully the transition is smooth and easy.

Thanks.

3 Likes

I managed to deploy using decoupled mode with minimal issues. We just had to change the wordpress installation to api.domain.com & update links, and update the htaccess to redirect any non wp-admin/wp-json/wp-content requests through to domain.com!

3 Likes