Opened 2 years ago
Last modified 7 months ago
#16096 new defect (bug)
editing permalink structure in edit site causes 404s on site
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Network Admin | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
If you edit a sites permalink structure in the network admin edit site screen, the site's rewrite rules do not get updated. The permalink_structure option is used to generate the permalinks on the front end of the site. Hence the rewrite rules will not match the permalinks until the permalink settings screen is visited in the site's dashboard.
The two alternatives are remove the permalink setting from the edit site screen or clear the rewrite rules.
I'm attaching a patch to clear the rewrite rules. The patch uses update_option instead of delete_option because update_option leaves the empty option in the object cache. If the option is deleted then WP will query the DB, add rewrite_rules to the notoptions cache, generate the rules, update the DB & remove rewrite_rules from the notoptions cache.
Attachments (2)
Change History (12)
comment:2
follow-up:
↓ 9
greuben
— 2 years ago
I don't think its a regression. Instead of update_option, we can use flush_rewrite_rules?
comment:3
ryan
— 2 years ago
Patches seem fine, but we're very close to release and this is not a regression. Suggesting punt to 3.2.
comment:4
wpmuguru
— 2 years ago
In 3.0 it had delete_option & I've explained why I used update_option instead.
https://core.trac.wordpress.org/browser/branches/3.0/wp-admin/ms-edit.php#L252
comment:6
nacin
— 2 years ago
- Keywords punt added
Editing the permalink structure here should be a YMMV situation.
comment:9
in reply to:
↑ 2
wpmuguru
— 2 years ago
Replying to greuben:
I don't think its a regression. Instead of update_option, we can use flush_rewrite_rules?
No, you cannot flush rewrite rules while switched.
comment:10
SergeyBiryukov
— 7 months ago
- Keywords punt removed
Is this a regression?