Ticket #6603 (new defect)

Opened 5 months ago

Last modified 3 weeks ago

bad next_posts_link when using a Static Front Page and custom permalink structure.

Reported by: robanna Assigned to: ryan
Priority: high Milestone: 2.7
Component: General Version: 2.5
Severity: major Keywords:
Cc:

Description

I'm using the following link structure:

Front page displays A static page (select below)

  • Front page: Home (www.apexprd.org)
  • Posts page: News and Events (www.apexprd.org/news-and-events)

- Permalinks: /news-and-events/%postname%

In 2.3 this worked fine, I would get post pages under www/apexprd.org/news-and-events/page/2.

In 2.5, posts show up as www.apexprd.org/page/2 and not /news-and-events/page/2 as it should. The link for next_posts_link shows as /news-and-events/page/2 but when you click on it, it returns a 404 error.

If I change the permalink to anything but /news-and-events/ then it goes to the correct page

Example: permalink structure is /news-and-events/%postname% click on next_posts_link and you get a 404 error. everything else works as it should

Change the permalink structure is /news-and-event/%postname% (remove the 's' on events) click on next_posts_link and it goes to /news-and-events/page/2/ just fine but all of the post links look like /news-and-event/post-name

Could it be something in the rewrite.php file?

Change History

04/05/08 23:56:47 changed by robanna

  • summary changed from bad next_posts_link when using a Static Front Page. to bad next_posts_link when using a Static Front Page and custom permalink structure..

04/07/08 20:11:28 changed by robanna

  • milestone changed from 2.7 to 2.5.1.

04/07/08 22:17:07 changed by dhardy

  • priority changed from normal to high.
  • severity changed from normal to major.

I am having the same problem. I would like to ask that the priority be increased on this as it will cause problems for numerous users and ultimately make many current sites malfunction.

04/07/08 22:58:34 changed by ryan

Look at line 1002 of wp-includes/rewrite.php.

http://trac.wordpress.org/browser/tags/2.5/wp-includes/rewrite.php#L1002

Change that line from this:

$this->use_verbose_page_rules = false;

to this:

$this->use_verbose_page_rules = true;

Change false to true. With that done, go to the Settings->Permalinks page and click "Save Changes". Does that help? If so I can create a plugin that does that for you. I'll try to fix this properly for 2.5.1, but given that this setup works more by accident than design a proper fix might be difficult.

04/08/08 02:00:16 changed by robanna

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

That looks like it'll fix it. Thanks-

04/08/08 03:11:41 changed by Viper007Bond

  • status changed from closed to reopened.
  • resolution deleted.

Not fixed, reopening.

04/08/08 03:12:07 changed by Viper007Bond

(Not that I'm having this problem, just saying editing core != fixed.)

04/08/08 17:12:09 changed by ryan

  • owner changed from anonymous to ryan.
  • status changed from reopened to new.

07/15/08 04:27:36 changed by dhardy

Has this been fixed in 2.6?

07/15/08 04:37:56 changed by ryan

  • milestone changed from 2.5.2 to 2.7.

07/16/08 02:07:45 changed by dhardy

Thanks I will check back when 2.7 is out ;-)

07/16/08 17:52:29 changed by mtekk

Closed #7200 as a duplicate of this.

Also in case you did not notice, it is not the s that is causing it. What happens is if that first part of the permalink is the same as your posts page the links look correct but lead to 404s or a post that WordPress thinks redirecting you to is the most proper thing.

07/24/08 05:56:00 changed by creativeworldstudio

Hi Ryan - I've documented some of this issue in this thread: http://wordpress.org/support/topic/159406#post-802603 - Just posting as it might help with clues to resolving this issue.

08/02/08 05:19:47 changed by markmathson

I was experiencing this issue, am using 2.6, and just fixed it using Ryan's recommended method described above.

So far I have not seen any negative side-effects.