× Here you can get community support related to ReDJ.

Help with redirect

  • mkrokos
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago - 10 years 3 months ago #2915 by mkrokos
Last edit: 10 years 3 months ago by mkrokos.

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

More
10 years 3 months ago #2917 by admin
Replied by admin on topic Help with redirect
Hi Manos,
sorry for delay to answer... I'm still on holidays :)

First let me do a brief summary of the current situation. You now have a single rule:
From URL: ^/συνταγές/μαγειρική/
To URL: http://{siteurl}/syntages/mageiriki/${id}-${alias}
Decode URL. true (checked)
Request only: true (checked)

Which we created for these URLs:

www.lovecooking.gr/συνταγές/μαγειρική/1381-Mοσχαρίσιο-φιλέτο-ψητό
www.lovecooking.gr/συνταγές/μαγειρική/item/1381-Mοσχαρίσιο-φιλέτο-ψητό
www.lovecooking.gr/συνταγές/μαγειρική/μοσχάρι/1381-Mοσχαρίσιο-φιλέτο-ψητό

To redirect to:
www.lovecooking.gr/syntages/mageiriki/1381-mosxarisio-fileto-pshto

But now you would like to change THE SAME RULE to manage these:

www.lovecooking.gr/συνταγές/μαγειρική/1381-Mοσχαρίσιο-φιλέτο-ψητό
www.lovecooking.gr/συνταγές/μαγειρική/item/1381-Mοσχαρίσιο-φιλέτο-ψητό

To pull the category and insert into the new URL like this:

www.lovecooking.gr/syntages/mageiriki/mosxari/1381-mosxarisio-fileto-pshto

The category (I guess) is "mosxari", right? If so, we should check if is possible to extract this from the database using one of initial information:

συνταγές
μαγειρική
1381

Could you take a look at k2 tables?

Tnx,
Luigi

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

  • mkrokos
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #2919 by mkrokos
Replied by mkrokos on topic Help with redirect
Hello Luigi,

the only way I can think of is to make a query that will do the following:

- Pull the catid from the K2 item with the id 1381
- Pull the alias of the category with that catid

Sounds like mission impossible, right?

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

  • mkrokos
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #2920 by mkrokos
Replied by mkrokos on topic Help with redirect
I have tried to add a placeholder for catalias but it's not returning anything. Unfortunately, it won't let me post it here, not even wrapped in [code] tags. Too much security! :D

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

More
10 years 3 months ago #2921 by admin
Replied by admin on topic Help with redirect
Yeah,
there's a protection against SQL injection, protection is never enough... :)

Try to add these placeholders:
catid={placeholder_select #__k2_items,catid,id=id}
catname={placeholder_select #__k2_categories,alias,id=catid}

Let me know...

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

  • mkrokos
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago - 10 years 3 months ago #2922 by mkrokos
Replied by mkrokos on topic Help with redirect
Ah, yes! And the To URL would become something like:
http://{siteurl}/syntages/mageiriki/${catname}/${id}-${alias}

Correct?
Last edit: 10 years 3 months ago by mkrokos.

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

Time to create page: 0.164 seconds