[wp-trac] Re: [WordPress Trac] #7396: permalink structure /%post_id%-%postname%-%category%-%year%-%monthnum%-%day% returns 404 s only

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 24 22:37:54 GMT 2008


#7396: permalink structure
/%post_id%-%postname%-%category%-%year%-%monthnum%-%day% returns 404 s only
----------------------+-----------------------------------------------------
 Reporter:  hquadrat  |        Owner:  anonymous
     Type:  defect    |       Status:  closed   
 Priority:  high      |    Milestone:           
Component:  General   |      Version:  2.6      
 Severity:  blocker   |   Resolution:  wontfix  
 Keywords:            |  
----------------------+-----------------------------------------------------
Comment (by hquadrat):

 One way of solving a problem has ever been just saying it's not there :-).
 For one user it works, for the other not and instead of finding a solution
 it is declared as not exisiting? Why did it work in 2.5.1. of scratch
 without any additional work or manipulation? What was changed? And why
 does it work for other folks even in 2.6. (possible solution see in the
 end)?

 A regex reading out the post-id from those URLs can easily be done

 {{{
 RewriteRule /(\d+)-([-0-9a-z]*) index.php?p=$1 [L]
 }}}

 but I understand it might not be that easy to do it in a generic/abstract
 way to match all possible combinations a user could choose.

 Removing the categories somewhat skipped the issue BUT what can be learned
 for the future is: when you combine those two placeholders and in case
 there are similar words in category name and post name serious problems
 can ocurr. Yes, agreed. But it's not generally evil, it's far away from
 that.

 One measure against the regex failing for the above case would be: let it
 stop at the first occurrence of whatever end-criteria for a category or
 post name and not letting it go till the last appearance (regex not being
 'greedy') - that is one behaviour discussed with regex more or less often.

 And this regex behaviour must have been regareded AND implemented in WP
 2.5.1 because otherwise the links would have failed before.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7396#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list