× Here you can get community support related to ReDJ.

redirect complicated url

More
10 years 6 months ago #1682 by admin
Replied by admin on topic redirect complicated url
I need more info:

Notice that 24/29/ are cats[0]=22&cats[1]=24


I can't see the 22. How should I know it?

and property_for_Sale is field_29=Sale


In the source URL there's SALE, while in the destination there is Sale. Is an error?

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

  • darkhoros
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 6 months ago - 10 years 6 months ago #1683 by darkhoros
Replied by darkhoros on topic redirect complicated url
Hi,
Thank you for you reply.
yes SALE it typo it is Sale

source URL:
www.domain.com/24/29/property_for_Sale/Uptown%20Cairo

Target URL which must be 200 internal:

www.domain.com/index.php/component/joomd/real-estate-egypt/search-results.html?cats[0]=24&cats[1]=29&field_29=Sale&field_33[0]=Uptown%20Cairo

Notice that 24/29/ are cats[0]=24&cats[1]=29
and property_for_Sale is field_29=Sale
and Uptown%20Cairo is field_33[0]=Uptown%20Cairo
I have corrected the numbers and Sale word, so it is aligned now.
the static parts of the target URL are as follows:
www.domain.com/index.php/component/joomd/real-estate-egypt/search-results.html?cats[0]=??&cats[1]=??&field_29=???&field_33[0]=???

I have replaced question marks for the dynamic parts that should be captured from the source url.
Dose this clear the image?

Thank you.
Last edit: 10 years 6 months ago by darkhoros.

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

More
10 years 6 months ago #1685 by admin
Replied by admin on topic redirect complicated url
Here is the rule:
From URL: ^/[0-9]+/[0-9]+/[^/]+/[^/]
To URL: http://{siteurl}/index.php/component/joomd/real-estate-egypt/search-results.html?cats[0]=${a}&cats[1]=${b}&field_29=${e}&field_33[0]=${d}
Case sensitive: true
Request Only: true
Decode URL: true

And add this to placeholders:
p={path}
a={preg_subject 1,${p}}/\/([0-9]+)\//i{/preg_subject}
b={preg_subject 2,${p}}/\/([0-9]+)\/([0-9]+)\//i{/preg_subject}
c={preg_subject 3,${p}}/\/([0-9]+)\/([0-9]+)\/([^\/]+)\//i{/preg_subject}
d={preg_subject 4,${p}}/\/([0-9]+)\/([0-9]+)\/([^\/]+)\/([^\/]+)/i{/preg_subject}
e={preg_subject 1,${c}}/property_for_(.*)/i{/preg_subject}

Kind regards,
Luigi

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

  • darkhoros
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 6 months ago #1686 by darkhoros
Replied by darkhoros on topic redirect complicated url
PURE BRILLIANCE.
Never thought that I will ever get over value for something I bought.

One more thing
my source URL:
www.domain.com/24/29/property_for_Sale/mivida
Notice mmivida at the end of the line, I found that I have already a rule with source URL: /mivida$
so it is conflicting with the new rule we are working with, so I decided to change the source url to

www.domain.com/24/29/property_for_Sale/compound-mivida
how do I add place holder for the last part, like the thing you did with property_for_Sale

And if you please, if you have the time to explain each line what it dose, for the sake of all you clients, to understand and develop knowledge of your component.

Thank you alot for you great work, and ever greater support.
Thank you.

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

More
10 years 6 months ago #1687 by admin
Replied by admin on topic redirect complicated url
Hi,
just a question about this rule:

Notice mmivida at the end of the line, I found that I have already a rule with source URL: /mivida$


Which full URL should match? Maybe we can specify the rule better...

About to explain, I know that less then 1% of my users know these feature, and I'm trying to add online documentation to the site. The main problem is "lack of time"... :(

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

  • darkhoros
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 6 months ago #1688 by darkhoros
Replied by darkhoros on topic redirect complicated url
Hi,
Thank you for your reply.
I didn't understand you last comment.
But old rules I can't modify as they are indexed with google, so best thing to do is to make the new full url looks like:
www.domain.com/24/29/property_for_Sale/compound-mivida
So all I need to add as non-dynamic is the word compound- as shown in the end of the url.
Thank you again.

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

Time to create page: 0.095 seconds