What I would like to have happen is if someone visits domain.com/summit, it will redirect to the latest year. So, if the years are 2021, 2022, 2023, it will redirect to summit/2023.
Ideally, this is a 302 redirect. It’s not permanent and will change every time a new year is added.
Really having a hard time figuring out how to 1) do a 302 redirect, and 2) how to do any kind of redirect dynamically.
I’m fine writing custom scripts if necessary. Appreciate any help!
Al
Make sure {{ slug }} is the actual embed field you have the year in.
Publish and try it out.
Notes;
replace overwrites history, so Back won’t go back to the redirect page ( which is good ).
This is design to go to the latest year in the CMS, not the current year. Use the current year instead in your JS if you want that.
You’ll see a flicker as the page begins /summit loading. To minimize that, you can remove all other content, and make the background solid white or black to match the rest of your site. If for some reason it’s slow, you could add a loading lottie.
Hey @memetican - thanks for this reply and sorry for the delay. Been on travel and missed it.
So this isn’t really a 301 nor a 302, which I think is fine, and a pretty creative way to handle it. Do you know how search engines perceive this kind of redirect?