Sure, it’s not different from any other URL.
If you need to match multiple URLs then you can use a regular expression:
https://redirection.me/support/redirect-regular-expressions/
Thread Starter
deyil
(@deyil)
@johnny5 thank you for your answer and your excellent plugin.
I understand that this can be achieved by regex but since this is a more complicated regex, I am not experienced with it.
Because it is a common scenario Language redirection (I have found several solutions with htaccess), I asked to see if someone has already implemented this with your plugin to show me how.
I tried importing htaccess but it didn’t work 🙁
Regular expressions are not specific to Redirection. I understand that they are a complicated subject, but there is a lot of information about them on the internet, and so I can only suggest you look through other examples, and use something like https://regex101.com/, to achieve the result you want.
Maybe if you post what you’ve tried then it might be easier to give suggestions.
Thread Starter
deyil
(@deyil)
After some trials and errors, I came with the following rule. I know it is not perfect, but I hope it helps others. Also, any suggestions for improvements are welcomed.
SOURCE
/(.*)lang=([a-z]{2})(&?)
TARGET
https://domain.com/$2/$1