Four Digit Permalink Problem
-
I believe this already logged as bug ID 7467 in the Trac system for WordPress, but I need to get this working before 2.7 and it is as yet unresolved. So if someone could point me in the right direction, I might be able to fix this and contribute it back to the source.
Having migrated some posts from another system, I have a custom permalink system to preserve the old URLs as much as possible:
/content/%postname%/
During the migration, I’ve used an exist ID number as the postname so the permalinks are like this:
https://www.site.com/content/1/
https://www.site.com/content/10/
https://www.site.com/content/100/
https://www.site.com/content/1000/
https://www.site.com/content/10000/All of those work except the one with four digits where postname = 1000. I can use this URL (https://www.site.com/?p=1000) with permalinks turned off and it displays the correct post, but not the one using the custom permalink structure. Since I have about 42K posts, that means that roughly 20 percent of them return 404 not found pages.
I would think this problem originates in /wp-includes/rewrite.php and possibly here in lines 16-18…
if (strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%') { return; }
Anyone with experience hacking the original source that thinks this would fix the problem or who has a better idea for solving this issue until it’s officially resolved?
Thanks,
Dennis
- The topic ‘Four Digit Permalink Problem’ is closed to new replies.