Opened 14 years ago
Closed 14 years ago
#15487 closed defect (bug) (fixed)
Custom permalinks redirecting back to category list instead of post
Reported by: | tott | Owned by: | garyc40 |
---|---|---|---|
Milestone: | 3.1 | Priority: | high |
Severity: | blocker | Version: | 3.1 |
Component: | Canonical | Keywords: | |
Focuses: | Cc: |
Description
Using a custom permalink structure such as
/%category%/%post_id%/%postname%/
hitting a post permalink will redirect you back to the category although debugging via a filter attached to parse_request shows the correct query (matched_query).
Attachments (3)
Change History (29)
#1
@
14 years ago
- Component changed from Rewrite Rules to Canonical
- Keywords needs-patch added; permalink_structure wp_rewrite rewrite removed
- Milestone changed from Awaiting Review to 3.1
#3
@
14 years ago
canonical.php is confused. I think it sees this as a tax query rather than a single post query.
#4
@
14 years ago
It is broken for all instances of %category% in your permalinks e.g. /archives/%category%/%postname% is broken as well
#8
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Still broken, and is sort of worse now. Can end up in infinite redirect loops, or lead to pages instead of posts. Must be more to this, unless I have borked my testbed install somehow.
From what I can tell, if there is only one post in the category WordPress is able to find the correct page 100% of the time. If there are multiple posts in the category, it seems like the most recent post is the only one that will load reliably. This is true for all categories except the default category (Uncategorized or as I have it renamed General). The default category is broken, all of the posts that are members of it end up getting stuck in redirect loops.
#9
@
14 years ago
- Priority changed from normal to high
- Severity changed from normal to blocker
My fault... had some code in mu-plugins that was messing with redirects. I see the problem exhibited fully, now. Bumping up priority/severity. Can take a look tonight, but if someone wants to take a swing in the meantime, go ahead.
is_category should be FALSE for these requests, because they're is_single requests. And the category portion of the URL is typically ignored when making the query (because you have a unique post slug or ID) — that may have changed in 3.1
#15
@
14 years ago
- Cc tar.gz added
- Resolution fixed deleted
- Status changed from closed to reopened
I'm currently running 3.1-beta1-16732 and I see this issue reappearing on a site that was fine in WP 3.0.3.
My custom link structure is: /%year%/%category%/%postname%/ (since starting with %category% is not recommended for performance reasons).
#16
@
14 years ago
Note: the previous beta build i was running was [16723], here the permalinks were still working.
Note2: a custom structure such as /%year%/%postname%/ works fine, so it's really the %category% that causes the trouble.
#19
@
14 years ago
- Keywords needs-patch added; has-patch removed
The last patch works but is not returning proper results
[15825]