Is it possible to host your only one of your page in different subdomain?

Hi All,
I’m wondering if we can point only one of out page in a project to the another subdomain.
For example I have project hosted on example.com. For only 1 page instead of example.com/anotherpage i want to use anotherpage.example.com

Is it possible to do that without doing in a new project?


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hi Beril, so what you’d want to do is

  • Connect your domain and subdomain to the project
  • Make the pages you do not want to be published to the sub-domain as drafts and set that page as a homepage (homepages cannot be saved as drafts)

    -Untick your main domain from the publish panel and tick the sub-domain and then publish

something similar to your issue here

Thank you for reply,
Unfortunately my website has more than 30 pages already. Save as a draft one by one with this method will be really hard. Because i guess for every update for both env. i need to do same process over again.

I guess there is no other way to do that.

Thank you

Hmmm from looking around this seems to be the only way would’ve been nice if you could make a folder as a draft containing all the pages hope Webflow implement this feature!

@austin do you have any ideas if this could be done quicker?

Hi Beril, what you’re describing here is a second website. However it’s possible to hack this type of behavior onto a single Webflow-hosted site in a couple of ways.

IMPORTANT: See Facundo’s notes below. Browsers restrict location history updates such that the domain name cannot be visibly changed, which means that approach #1 and #2 won’t fully achieve the desired result. I’ll leave them here as documentation, but Reverse Proxy or self-hosting are the only ways to achieve this completely.

SECOND DOMAIN, AND SCRIPTED REDIRECTS

  • Add your subdomain as an second domain on the site, and do NOT set a default domain. All pages on your site will then respond to either https://anotherpage.example.com/... or https://example.com/
  • Add a small piece of script to your site-wide custom code. If someone tries to access any URL with the anotherpage.example.com hostname, you’ll redirect them to /anotherpage.
  • Add another small piece of script just to your /anotherpage, which resets the URL history so that the URL being displayed is https://anotherpage.example.com.

EXTERNAL REDIRECT

Similar to above, but in some DNS providers like Cloudflare you can set subdomain redirection rules. In Cloudflare you’d setup a CNAME and a Rule for the redirect, and you’d still need step 3 above.

REVERSE PROXY

This is the most complex however it’s the only way to get full control over the URLs on a Webflow-hosted site. There are some guides in the forums.

SELF-HOSTED SITE

If you do not need Webflow’s CMS, ECommerce, Memberships, Logic, form submission handler, etc, you can self-host your site. When exported to your own environment, you will have full control over the server configuration, since you set that up yourself.

1 Like

Hi Michael.

I need to do the same as the OP for a client and after reading many posts in the forum, that is a really good summary of the solutions we have available nowadays. I appreciate the clarity.

A few more questions:

  1. About the easiest solution (1st step): nowadays I have the www.example.com as default and example.com as not default. If I remove the 2nd (example.com) and add the anotherpage.example.com in it’s place, what would happen when someone tries to enter example.com?

  2. About the easiest solution (3rd step): you mean a script to change the visible url to anotherpage.example.com? I thought you only could do that but only to the pathname part (with window.history.replaceState). Am I wrong?

Side note: the client is using GoDaddy as domain service, and I see that it exists a “Subdomain forwarding (to a specific URL)”. Do you know if that would work as a direct solution?

Thanks in advance!

If you want to support example.com by itself, you’ll want to use a DNS that supports CNAME flattening and configure Webflow appropriately. Webflow’s docs cover that pretty well.

Ah! Good catch, yes that’s correct, and that renders option 1 moot. :expressionless: