[wp-docs] Custom permalink structures: best practice

Mike Schinkel mikeschinkel at newclarity.net
Tue Jul 13 21:36:15 UTC 2010


On Jul 13, 2010, at 5:23 PM, Lorelle on WordPress wrote:
> 
> That's awesome. I just took a glance but it appears to deal specifically with same name subdirectories.

The ticket started out with that but it evolved into something much bigger as I explored what was needed.  If you have time, scan the entire thing.

> Would that same thing apply to the issue at hand? By making the process of using names not numbers not slowing down the database and addressing the issues outlined by Otto? If so, I'll be the first one on board! 

Yes, exactly.  In summary it would be to create a system that replaced as little in WordPress as absolutely necessary but that inspected and routed URLs by path segment instead of by attempting to match against the full URL.

So if you wanted /%category%/$post_name%/ and there was a category of /fiction/davinci-code/ then it would first look at "fiction" to see if it is a category and there is then it would look for a post of "divinci-code" but if no match for category="fiction" then it would keep looking in the root of the URL space.  This model could much more easily be optimized and it would be easier to validate, i.e. we could validate URL slugs. So a page slug of "fiction" could be disallowed if there was a category called "fiction", assuming categories had priority over pages.  OTOH if pages had priority then we could disallow a category of "fiction" if there was a page called "fiction." 
(All of this should be configurable in code by the site developer.)

That's the vision, anyway.

-Mike

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-docs/attachments/20100713/38e27251/attachment.htm>


More information about the wp-docs mailing list