Redirect on the basis of a partial url

Hello
I would like to setup a single redirect that will cover lots of urls:

For example these original urls:

www.mysite.com/news-oct

www.mysite.com/news-nov

www.mysite.com/news-dec

Should all redirect to:
www.mysite.com/news-all

Is there a way of using a wildcard to do so?
for the original url something like www.mysite.com/news-*
redirects to www.mysite.com/news-all
I tried this but the redirect was not accepted.

Thanks for any help.

Hi @DM2,

Yes, you can use a wildcard but you would need to choose the Flexible redirect, instead of Standard redirect, and add *rest-of-URL instead of just the wildcard *.

So your “FROM” redirect would look like:

www.mysite.com/news-*rest-of-URL

However, you may need to have all those URLs produce 404s and disable the redirect if the URL exists because this might also redirect the /news-all, since the wildcard applies to “all” as well.

Hope this helps!

Thanks I tried:

www.mysite.com/news-*rest-of-URL

but unfortunately the redirect will not be accepted; I get this error message:

“The original URL in a flexible URL redirect has to contain “*” or “:”, followed by some text.”

My apologies - it is not obvious from that article but it appears that the wildcard redirect works only on full URL “components”, meaning it needs to be directly after the slash “/”.

If your URLs to had a slash “/” instead of a hyphen “-”, then you could set up the flexible redirect this way:

REDIRECT FROM
www.mysite.com/news/*rest-of-URL

REDIRECT TO
www.mysite.com/news/all

However, given that it is hyphens right now, your best bet would be to utilize the redirect bulk upload: Bulk upload URL redirects

no problem, thanks anyway.