Opened 9 months ago
Closed 9 months ago
#22084 closed defect (bug) (invalid)
Tag pagination issue on nginx-hosted installs
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Rewrite Rules | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Due to the seeming lack of tickets on this, I'm going to assume it's an nginx-specific issue.
Basically, since 3.4 I've had to include a custom function on each of my nginx-hosted WordPress installations to get tag pagination to work:
add_action('init','yoursite_init');
function yoursite_init() {
global $wp_rewrite;
//add rewrite rule.
add_rewrite_rule("tag/(.+?)/page/?([0-9]{1,})/?$",'index.php?tag=$matches[1]&paged=$matches[2]','top');
$wp_rewrite->flush_rules(false);
}
Without the code block, I either get a 310 Error (redirect loop) or a random page is spitted out.
Change History (4)
comment:1
markoheijnen
— 9 months ago
comment:2
SergeyBiryukov
— 9 months ago
Didn't test with nginx yet, but the rule in yoursite_init() is similar to the default one:
tag/([^/]+)/page/?([0-9]{1,})/?$ => index.php?tag=$matches[1]&paged=$matches[2]
tag/(.+?)/page/?([0-9]{1,})/?$ => index.php?tag=$matches[1]&paged=$matches[2]
The only difference is ([^/]+) vs. (.+?), which doesn't seem relevant.
Note: See
TracTickets for help on using
tickets.
It seems you have something else wrong. For me it works on a test site running 3.4.1.