Right now I have a bunch of old blog posts that I need to update to the new url structure. I added /blog/
to all of the new url, and old existing links just have the old format without the /blog/
piece of the url. The former pages on the blog had no unique piece to their url to match them together so this is proving difficult for me to redirect.
Is there a way to use regex/or something else to create a simple redirect that will capture all links for each blog page, for example one of the old links looks like:
/example-here/?utm_campaign=test&utm_medium=email&utm_source=hubspot&utm_content=blog
I want it to become:
/blog/example-here/?utm_campaign=test&utm_medium=email&utm_source=hubspot&utm_content=blog
I also want all urls that contain the piece /example-here/
to redirect to /blog/example-here
How would I do that?
Thank you!