Dolphiq / craft-plugin-redirect

Craft 3 redirect plugin provides an easy way to enter and maintain 301 and 302 redirects and 404 pages. The plugin provides a clear user interface for admin and non-admin users.
MIT License
54 stars 34 forks source link

How to redirect a path using wildcards? #118

Closed oadslug closed 2 years ago

oadslug commented 4 years ago

I looked through all the examples, but I'm not seeing a way to redirect a path using wildcards to account for additional segments. I apologize if I've missed something obvious.

I am trying to redirect: "oldcategory/any/number/of/additional/segments" to: "newcategory/any/number/of/additional/segments"

I have tried: oldcategory/<options:.+> newcategory/<options:.+>

That doesn't seem to work. Are there other wildcard twig patterns? or can I use grep?

Any help would be much appreciated. Thank you.

alexroper commented 2 years ago

I had the same question, but this plugin seems to be abandonware. This worked for me:

Source URL: oldcategory/<options:.+>

Destination URL: newcategory/<options>

You don't need to use the word "options" however. I used <segments.+>.