Help with redirect
-
mkrokos
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 15
-
Thank you received: 0
-
-
10 years 4 months ago - 10 years 4 months ago #2895
by mkrokos
Last edit: 10 years 4 months ago by mkrokos.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 4 months ago - 10 years 4 months ago #2897
by admin
Hi Manos,
it is possible but first I need some additional information.
1) You could create a rule for each category / subcategory (i.e. the destination includes statically /syntages/mageiriki/) or do you want to set them dynamically (looking up the database) and have just a single rule (more complex)?
2) The key to connect old URLs to new ones is the id (i.e. 1381). We could lookup the database to get the alias mosxarisio-fileto-pshto and build the destination. Could you check if this is the K2 alias?
Kind regards,
Luigi
Last edit: 10 years 4 months ago by admin.
The following user(s) said Thank You: mkrokos
Please Log in or Create an account to join the conversation.
-
mkrokos
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 15
-
Thank you received: 0
-
-
10 years 4 months ago #2899
by mkrokos
Hello Luigi and thanks for the reply!
I am sorry but I don't understand exactly what you mean. But I will show you the tree structure and you might understand how it goes:
Syntages (parent category, means 'recipes' in greek)
- mageiriki (child category, means 'cooking')
- zaxaroplastiki (child catefory, means 'pastry' or 'confisserie')
- pota (child category, means 'drinks')
so the destination includes 'syntages' (almost 95% of the times) and then one of the three children categories.
Then follows the item id (ie, 1381) and then the item alias (mosxarisio-fileto-pshto) separated by a dash (-)
Is that sufficient information?
Kind regards,
Manos K
Please Log in or Create an account to join the conversation.
-
mkrokos
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 15
-
Thank you received: 0
-
-
10 years 4 months ago - 10 years 4 months ago #2900
by mkrokos
Also this form should be added to the list of "From URL" (yet another subcategory followed by '/item')
lovecooking.gr/συνταγές/μαγειρική/μοσχάρι/item/1381-Mοσχαρίσιο-φιλέτο-ψητό
('μοσχάρι' stands for 'veal')
Last edit: 10 years 4 months ago by mkrokos.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 4 months ago #2901
by admin
Hi Manos,
what you want to do is possible but not so easy (and almost impossible without database access). I try to explain you how to create the rule (you need to play with macros and placeholders). The rule should be:
From URL: ^/συνταγές/μαγειρική/
To URL: http://{siteurl}/syntages/mageiriki/${id}-${alias}
Decode URL. true (checked)
Request only: true (checked)
Now you need to define the placeholders:
id={preg_match 1}/\/([0-9]+)-/i{/preg_match}
alias={placeholder_select #__k2_items,alias,id=id}
But you should check the alias placeholders if is right for your database.
Kind regards,
Luigi
The following user(s) said Thank You: mkrokos
Please Log in or Create an account to join the conversation.
-
mkrokos
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 15
-
Thank you received: 0
-
-
10 years 4 months ago - 10 years 4 months ago #2902
by mkrokos
Hello Luigi, come stai?
I have tried what you suggested but the returning URL produces a 404 error because it isn't decoding the preg expression or something:
The resulting link
Actually, I can't paste the URL here without it being translated but you see what I mean.
Kind regards,
Manos K
Last edit: 10 years 4 months ago by mkrokos.
Please Log in or Create an account to join the conversation.
Time to create page: 0.163 seconds