Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#6650 closed defect (bug) (fixed)

PATHINFO permalinks structure broken in 2.5

Reported by: dlo's profile dlo Owned by: ryan's profile ryan
Milestone: 2.5.1 Priority: highest omg bbq
Severity: blocker Version: 2.5
Component: General Keywords: page permalink pathinfo rewrite.php
Focuses: 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 (1)

rewrite.php (33.6 KB) - added by dlo 17 years ago.
Corrected rewrite.php for PATHINFO permalinks

Download all attachments as: .zip

Change History (7)

#1 @dlo
17 years ago

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;

@dlo
17 years ago

Corrected rewrite.php for PATHINFO permalinks

#2 @dlo
17 years ago

  • Keywords page permalink pathinfo rewrite.php added

#3 @dlo
17 years ago

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

#4 @ryan
17 years ago

  • Owner changed from anonymous to ryan

#5 @ryan
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

#6 @ryan
17 years ago

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

Note: See TracTickets for help on using tickets.