Linking to most recent CMS item

Hi! New to the community, but appreciate your clicking to help me out.

I am looking for a way to get a link to redirect to the most recent item page in a collection. Specifically, I want a specific subdomain to redirect to it, so when the user types in “x”.“x”.com, it takes them to the most recent CMS item page.

Is this possible?

Thank you!!

Heh heh, it would be a rather convoluted setup, with 3 problems to solve;

MOST RECENT ITEM
This isn’t really a thing in Webflow, as the automated publishing dates are designed for internal use. However if you add your own Published Date to the CMS, and represent it correctly, it’s easy to sort on and won’t change arbitrarily.

REDIRECT TO NEWEST
With this, you could create a special page specifically for the “redirect to newest”. You’d drop a collection list, bound to your collection, sorted descending by date and limited to 1 item.

Inside of that collection you’d drop an embed, with javascript that redirects you to that one item’s path.

Now you have a page like /latest which redirects you to e.g. /blog/how-to-make-lasagne or whatever the most recent item is.

SUBDOMAIN REDIRECT
Webflow supports redirects, however they do not differentiate on subdomain. This means you’d need to handle the redirect externally- Cloudflare redirects is good and free for this, if your DNS can be moved to Cloudflare.

There you would specially redirect e.g. newest.myblog.com to www.myblog.com/latest and you’d have your setup.

Oh cool, this is super interesting. I already use cloudflare so this isn’t an issue. Thanks for this!

1 Like