Redirect all except root

Hi,

We recently decided to use webflow to build our landing page, and to let our application run in different subdomains. Now example.com is occupied by the webflow site, and the rest of the application is at app.example.com.

While redirection is working for all our resources, we had some (around 1500) dynamic urls at the root of our routes (one for each user), in this format : https://example.com/{slug-from-username}.

We tried adding a redirection from “https://example.com/(.*)” to https://userpage.example.com, but it redirects litterally everything, including the root itself “/”, so no one can land on the webflow site.

Is there any way to tell webflow to redirect only urls when the capture group is not empty, leaving the root url as it is ?

Thank you

I have not found a way to do this, but you might check with support, I do recall seeing a 301 hack that allowed the opposite to happen ( redirecting the homepage only ).

You have a couple of options here. The main one I’d recommend is to just load in your 1500 redirects. Not Ideal, I know, but it’s the best-aligned approach with Webflow’s design.

You can prep them all in a spreadsheet, export as CSV and bulk-import.

Another possibility is to use your 404 page for this purpose and add a redirect script there, however I’d be concerned about SEO damage as the 404 would be the first response that googlebot sees. It won’t delist it, but I wouldn’t be surprised if those links take a pagerank hit.

Another possibility is a reverse proxy. Can be complex and fragile to setup properly, but gives you full URL control once you have it.

Thanks for this detailed answer !

We thougth about the bulk import solution, but we were concerned about the warning on the documentation page :

Important: While Webflow currently doesn’t have a hard limit in place for total redirects, we recommend 1,000 maximum as best practice. Each redirect rule is uploaded to a site’s manifest.JSON file, which provides site information to visitors’ browsers. As the manifest file grows, there’s more data for browsers to download.

But I guess 1.5k is not that much bigger than 1k, plus the number of these urls won´t grow anymore.
I think we will try this first, as it seems the less “hacky” solution, and if it slows down the website too much we’ll try the other solutions.