Category, id, title redirect
-
womensagenda
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
-
womensagenda
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
9 years 1 week ago #4429
by womensagenda
So far, I have the following (attached in screenshot)
Placeholders:
id=5419
or
id=145
This gives me the result:
www.website.com/categoryX/subcategoryY/item/5419-original-article-title-goes-here-
I cannot get it to use a dynamic ID in the placeholder, and it is adding an extra hyphen at the end of the alias that I'd like to tidy up.
What I've been trying to do is return a substring of from the 9th character onwards of that end-of-url string, and use the returned value in the placeholder. Is this possible?
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
-
womensagenda
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
9 years 1 week ago #4431
by womensagenda
Here are a couple of examples:
/career-agenda/inspiring-women/jane-kennedy/20120724145
to
/career-agenda/inspiring-women/item/145-jane-kennedy
and
/talking-about/top-stories/dr-gabrielle-mcmullin-clarifies-junior-doctors-need-support-fighting-harassment/201503095419
to
/talking-about/top-stories/item/5419-dr-gabrielle-mcmullin-clarifies-junior-doctors-need-support-fighting-harassment
We do have a lot of old->new URLs, the number may be in the thousands. The IDs of the articles could be either 3 or 4 digits.
I can PM you a large list of old URLs if that will help?
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
9 years 6 days ago - 9 years 6 days ago #4434
by admin
Hi,
the problem is that the id=145 in 145-jane-kennedy is needed for the destination to work, but is not present in the source url.
So to build the rule to redirect:
/career-agenda/inspiring-women/jane-kennedy/20120724145
to
/career-agenda/inspiring-women/item/145-jane-kennedy
You should first extract the jane-kennedy, use it to lookup the table for the id (if possible) and get the id 145, then use this to build up the destination.
Is it clear?
Last edit: 9 years 6 days ago by admin.
Please Log in or Create an account to join the conversation.
-
womensagenda
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
9 years 3 days ago #4454
by womensagenda
Your suggestion worked a treat, thank you Luigi!
Seems like I was SO close but just looking in the wrong direction
Thank you muchly!
Please Log in or Create an account to join the conversation.
Time to create page: 0.171 seconds