× Here you can get community support related to ReDJ.

Redirect to parent

  • keep2000
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 5 months ago #6724 by keep2000
Redirect to parent was created by keep2000
I have a question with ReDJ Enterprise.
There is a webshop which has a main menu alias (webshop), categories and products with suffix.
e.g.: mydomain.com/webshop/cat1/cat2/product1-details
I want to redirect the product to it's category when the product is unavailable for some reason (unpublished, etc)
So I want to redirect this: mydomain.com/webshop/cat1/cat2/product1-details to this: mydomain.com/webshop/cat1/cat2/
None of the url parts are fixed except the 'webshop' and the '-details' suffix.
Could you help me with this?

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

More
6 years 5 months ago #6730 by admin
Replied by admin on topic Redirect to parent
Hi,
I understand your request, and the problem is not to build the dynamic part of the rule. The real problem here comes from this sentence:

I want to redirect the product to it's category when the product is unavailable for some reason (unpublished, etc)


How can ReDJ understand that the specific product is unavailable? Consider that ReDJ works on URLs, so if there is nothing in the URL that indicates this condition I can't see a way to do it with ReDJ out-of-the-box.

Kind regards,
Luigi

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

  • keep2000
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 5 months ago #6732 by keep2000
Replied by keep2000 on topic Redirect to parent
Hi
As far as I can see ReDJ can handle this with 'Error only' param. I tested it with a rule, it was fired with unpublished (error 404) products but not with active ones.

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

  • keep2000
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 5 months ago #6735 by keep2000
Replied by keep2000 on topic Redirect to parent
It works with this:

From URL: webshop\/.*?\-details$
To URL: {scheme}://{siteurl}/${b}
Placeholders:
a={path}
b={preg_subject 1,${a}}/(.*?)\/(?!.*\/)/i{/preg_subject}

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

More
6 years 4 months ago #6748 by admin
Replied by admin on topic Redirect to parent
Thanks for reporting this.

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

Time to create page: 0.133 seconds