Redirect to parent
-
keep2000
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
6 years 5 months ago #6724
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
6 years 5 months ago #6730
by admin
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
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
6 years 5 months ago #6732
by keep2000
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
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
6 years 5 months ago #6735
by keep2000
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.133 seconds