Forum Moderators: phranque

Message Too Old, No Replies

Changing structure of a wordpress blog

How to properly configure the redirects?

         

julinho

12:34 pm on Dec 13, 2007 (gmt 0)

10+ Year Member



I have a Wordpress blog hosted on my server where I configured permalinks to be like domain.com/blog/post-title

I have decided to change the configuration to domain.com/blog/category/post-title

The problem is that the posts are already indexed, and the change would cause a lot of pages returning 404 to the spiders.
I would like to redirect 301 the old pages to the new pages.

What's the best way to do it?

TIA

jdMorgan

4:32 pm on Dec 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One way to do it would be:

Check to see if the /blog/category/post-title URL resolves to an existing file. If so, serve it. If not, drop the '/category' out of the /URL-path and repeat the above steps. If it still doesn't exist, then exit and let the 404 handler run as usual.

Jim

julinho

4:26 pm on Dec 14, 2007 (gmt 0)

10+ Year Member



Thanks, Jim.

I can live with the 404s, but the problem is that the blog has several external links pointing to internal posts; if I just delete the old permalinks, I will loose those links.

I found a plugin which supposedly changes permalinks and handles the respective 301s, but I didn't find it very reliable.

I am having a second thought about the changes.