Ticket #6650 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

PATHINFO permalinks structure broken in 2.5

Reported by: dlo Assigned to: ryan
Priority: highest omg bbq Milestone: 2.5.1
Component: General Version: 2.5
Severity: blocker Keywords: page permalink pathinfo rewrite.php
Cc:

Description

The PATHINFO permalink structure /index.php/%category%/%postname%/ leads to a "page not found" error when clicking on a page URL (but not on a post or category URL).

It seems that PATHINFO permalink structure beginning with /index.php/%category% or /index.php/%postname% or /index.php/%tag% or /index.php/%author% is broken for pages in WP 2.5 when it was valid in WP 2.3.3.

To get access to the pages, you have to change the PATHINFO permalink to /index.php/%year%/%category%/%postname%/, for instance.

Attachments

rewrite.php (33.6 kB) - added by dlo on 04/10/08 09:19:33.
Corrected rewrite.php for PATHINFO permalinks

Change History

04/10/08 09:17:36 changed by dlo

It looks like I found the solution:

Add a test in init() function of wp-includes/rewrite.php to check if we're using PATHINFO permalinks and thus, generate verbose page permalinks.

Code snippet:

if ( 0 === strpos($structure, '%postname%') ||
			 0 === strpos($structure, '%category%') ||
			 0 === strpos($structure, '%tag%') ||
			 0 === strpos($structure, '%author%') ||
				$this->using_index_permalinks() )
			 $this->use_verbose_page_rules = true;
		else
			$this->use_verbose_page_rules = false;

04/10/08 09:19:33 changed by dlo

  • attachment rewrite.php added.

Corrected rewrite.php for PATHINFO permalinks

04/10/08 09:49:29 changed by dlo

  • keywords set to page permalink pathinfo rewrite.php.

04/10/08 15:13:52 changed by dlo

  • summary changed from /index.php/%category%/%postname%/ permalink broken in 2.5 to PATHINFO permalinks structure broken in 2.5.

04/14/08 16:34:35 changed by ryan

  • owner changed from anonymous to ryan.

04/14/08 17:18:55 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [7665]) Handle pathinfo structures when determining if verbose page rules should be used. Props dlo. fixes #6650 #6570 for trunk

04/14/08 17:19:41 changed by ryan

(In [7666]) Handle pathinfo structures when determining if verbose page rules should be used. Props dlo. fixes #6650 #6570 for 2.5