× Here you can get community support related to ReDJ.

Redirect URLs matching condition

  • nunonog
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago #4745 by nunonog
Redirect URLs matching condition was created by nunonog
Hello,

Is it possible to redirect:
www.domain.com/anything-one-or-more-words/1234-etc.......

To:
www.domain.com/artigos/1234-etc........

The rule is: replace any words between the 1st and 2nd slashes if after the 2nd slash beggins with a 4 digit number by artigos.

Thank you for supporting!

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #4746 by admin
Replied by admin on topic Redirect URLs matching condition
It's tricky but let's try:
From URL: ^/[^/]*/[0-9]{4}-
To URL: {scheme}://{siteurl}/artigos/{preg_match 1}/\/[^\/]*\/(.*)$/{/preg_match}
Skip: /artigos/
Request only: true (checked)

I haven't tested, so let me know if it works or need to be adjusted.

Kind regards
The following user(s) said Thank You: nunonog

Please Log in or Create an account to join the conversation.

  • nunonog
  • Topic Author
  • Offline
  • New Member
  • New Member
More
More
8 years 8 months ago #4752 by admin
Replied by admin on topic Redirect URLs matching condition
Sorry,
I didn't notice you have the Community version, while the preg_match macro is only available in the Enterprise version.

I will try to adapt the rule using only community macros but, as I told you, this case is really tricky...

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.209 seconds