× Here you can get community support related to ReDJ.

Complex Redirect Rule

  • donald
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 months 2 weeks ago - 5 months 2 weeks ago #6883 by donald
Replied by donald on topic Complex Redirect Rule
I just tried it after installing the Enterprise version, and this is what I am getting as the call:

GET /directory/%7Bpreg_match%201%7D///directory//([%5E//]+)//([%5E//]+)//([%5E//]+)//all$/%7B/preg_match%7D/%7Bpreg_match%202%7D///directory//([%5E//]+)//([%5E//]+)//([%5E//]+)//all$/%7B/preg_match%7D/%7Bpreg_match%203%7D///directory//([%5E//]+)//([%5E//]+)//([%5E//]+)//all$/%7B/preg_match%7D/all/?cf43[0]={preg_match%201}/\/directory\/([^\/]+)\/([^\/]+)\/([^\/]+)\/all$/{/preg_match} HTTP/1.1

Why isn't it converting based on what I put in the placeholder field? See here how I am typing it: prntscr.com/kzvi4s

Here is the link I'm trying:
dev2.muslimlink.ca/directory/london/education/second-language-education/all
Last edit: 5 months 2 weeks ago by donald. Reason: more info added

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

  • donald
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 months 2 weeks ago #6884 by donald
Replied by donald on topic Complex Redirect Rule
Never mind, it was the decode checkbox that had to be on as well. It works now, I have one last question.

We are trying not to make these URL also go to the same thing

from:
/directory/london/babies-children/clothing-accessories/
/directory/london/babies-children/clothing-accessories

to:
/directory/london/babies-children/clothing-accessories/all?cf43[0]=london

I know that it's basically the same one you gave me before, but the "From URL" has to be changed.

Your original From URL was:
^/directory/.*/all$

I changed it to:
^/directory/.*$
^/directory/.*/$
and
^/directory/.*/.*/.*$
^/directory/.*/.*/.*/$

All didn't work. Your help is appreciated.

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

  • donald
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 months 2 weeks ago #6885 by donald
Replied by donald on topic Complex Redirect Rule

donald wrote: Never mind, it was the decode checkbox that had to be on as well. It works now...


I just noticed that the solution you gave me (almost) worked, but there is an extra / in the URL before the "?",

this: /directory/london/education/second-language-education/all
become this: /directory/london/education/second-language-education/all/?cf43[0]=london

Notice the "/" in red that shouldn't be there.

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

More
5 months 2 weeks ago #6893 by admin
Replied by admin on topic Complex Redirect Rule
It seems I am late to the party, sorry for this :)

Just to be sure, is this thread closed or there is still something to fix?

Thanks
Luigi

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

  • donald
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 months 2 weeks ago - 5 months 2 weeks ago #6896 by donald
Replied by donald on topic Complex Redirect Rule
Haha sorry about that.

Yes, there are two things left here:

1) There is an extra / in the URL before the "?",

this: /directory/london/education/second-language-education/all
become this: /directory/london/education/second-language-education/all/?cf43[0]=london

Notice the "/" in red that shouldn't be there.


2) We are trying not to make these URL also go to the same thing

from:
/directory/london/babies-children/clothing-accessories/
/directory/london/babies-children/clothing-accessories

to:
/directory/london/babies-children/clothing-accessories/all?cf43[0]=london

I know that it's basically the same one you gave me before, but the "From URL" has to be changed.

Your original From URL was:
^/directory/.*/all$

I changed it to:
^/directory/.*$
^/directory/.*/$
and
^/directory/.*/.*/.*$
^/directory/.*/.*/.*/$

All didn't work. Your help is appreciated.
Last edit: 5 months 2 weeks ago by donald. Reason: more info added

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

More
5 months 2 weeks ago - 5 months 2 weeks ago #6897 by admin
Replied by admin on topic Complex Redirect Rule
Hi Donald.

1) There is an extra / in the URL before the "?",
...
Notice the "/" in red that shouldn't be there.


This is a back-slash indeed and MUST be there. It means you want a literal question mark. Consider that ? has also a special meaning in regular espressions, so if you want it literal replace ? with \?.

from:
/directory/london/babies-children/clothing-accessories/
/directory/london/babies-children/clothing-accessories


The From URL is a matching pattern. This one:
From  URL: ^/directory/.*/all$

Means "starts with /directory/, then any chars, and finally /all and it ends".

In your case you have in common only the initial part, so just change it as:
From  URL: ^/directory/

There is no need for anything else, because the next piece is always different from URL to URL. It is the To URL that does the magic (a different target for each different source).

Kind regards
Luigi
Last edit: 5 months 2 weeks ago by admin.

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

Time to create page: 0.212 seconds