WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6650 closed defect (bug) (fixed)

PATHINFO permalinks structure broken in 2.5

Reported by: dlo Owned by: 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 7 years ago.
Corrected rewrite.php for PATHINFO permalinks

Download all attachments as: .zip

Change History (7)

comment:1 @dlo7 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;

@dlo7 years ago

Corrected rewrite.php for PATHINFO permalinks

comment:2 @dlo7 years ago

  • Keywords page permalink pathinfo rewrite.php added

comment:3 @dlo7 years ago

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

comment:4 @ryan7 years ago

  • Owner changed from anonymous to ryan

comment:5 @ryan7 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

comment:6 @ryan7 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.