The answer depends on how you are serving/hosting your site. Jekyll itself is just a tool for building sites, so Jekyll won’t be running when your site is live. I.e. Jekyll can’t directly route/redirect /foo/*.
Many servers/web-hosts have mechanisms to specify redirects. For example: Apache, NGINX, Netlify, and S3 all have different ways to setup redirects. Unfortunately, the popular Github-Pages hosting has no such mechanism.
@chuckhoupt I Want to Say thank to You Chuck for sending this redirection method. I’m currently managing more than one thousand domain names that are registered for my customers.
In the old time, I have always used HTML to redirect, but after you gave me the solution, I decided to move on with HTTP redirection for my new clients.
After a few days of testing, check and compare how they work. I can agree for sure that HTTP redirection is more fit and good speed than HTML redirection.
@chuckhoupt dang, after i transfer to a HTTP redirections my customers scream at me because it make their link redirect being blocked by some social media like facebook, zalo, twitter… it force me to downgrade back to meta tag redirection. what a mess. i will never never do that again after testing if it fit and suite for business way around.