[wp-hackers] Changing page permalink structure

Bryan Petty bryan at ibaku.net
Tue Oct 2 17:30:41 UTC 2012


I must have been confused with posts rather than pages by accident for
my last tests. For posts, having tested this in 3.4.2 and 3.5-beta-1,
any change in any slug regardless of any intermediate slug structure
does work in every case. Even old final post slugs with completely
arbitrary intermediate structures are redirected to the correct post.
This doesn't always work for pages though, so maybe this is a bug that
can be fixed in WordPress.

On Tue, Oct 2, 2012 at 9:46 AM, Benjamin Lupu <benjamin.lupu at gmail.com> wrote:
> - If I have the following URL :
> http://mydomain.com/page-slug-1/page-slug-2/page-slug-3/
> - If I change /page-slug-3/ to /page-slug-ZZZ/ in the Edit Panel, I get a
> 404

This is true, I also get a 404 in this case. This is where I think
there might actually be a bug with pages since this works with posts.

> - If I turn the URL into http://mydomain.com/page-slug-3/, a 301 redirect
> is done to http://mydomain.com/page-slug-1/page-slug-2/page-slug-3/(redirect
> is based on the page slug). It also works if you have the
> following URL :  http://mydomain.com/page-slug-1/page-slug-3/
> - So we can say that reparenting is covered unless one of the slugs has
> changed.
> - If you change any slug (parents or the page itself) you get a 404

However, this is not what I see with either 3.4.2 or 3.5-beta-1. As
long as the final page slug remains unchanged, I can change any of the
parent page slugs, and the old URL will be redirected to the correct
page with the updated parent page slugs. I suspect this is just
because WordPress only looks at the final slug, not because it's
correctly tracking the parent page slugs, otherwise the case above
would probably work.

Regards,
Bryan Petty


More information about the wp-hackers mailing list