TikaL13
TikaL13

Reputation: 1488

How to redirect wordpress post links that are using post_id to new url struture of postname

I have a slight problem... we made a change to our url structure the other day and have broken links all over.

What I did was change links from:

http://blog.mydomain.com/articles/123

To:

http://blog.mydomain.com/articles/this-is-a-smaple

Is there anyway to direct any links linking to the pages ID number to the postname????

The old url structure is still being published throughout our RSS feed on facebook. So I am trying to catch those people that are or maybe clicking on our links on our facebook posts and redirect them to that posts postname url? Does that make sense?

Thanks and help would do

Upvotes: 0

Views: 1083

Answers (2)

Haris
Haris

Reputation: 1059

Matthew,

You can use the Advanced Permalinks plugin. It'll redirect old permalink structures to the correct posts. Checkout the description on the plugin page.

Upvotes: 1

Ben S
Ben S

Reputation: 69342

In your new URL handling code, check to see if everything after the last slash is decimal numbers, if so, use the old URL handling code.

Upvotes: 0

Related Questions