Make WordPress Core

Opened 20 years ago

Closed 19 years ago

Last modified 19 years ago

#2850 closed defect (bug) (worksforme)

Update permalinks not refreshing rewrite_rules in wp_options table

Reported by: meckhert's profile meckhert Owned by: robmiller's profile robmiller
Milestone: Priority: normal
Severity: major Version: 2.0.3
Component: Administration Keywords: permalinks wp_options rewrite_rules bg|has-patch
Focuses: Cc:

Description

When a user changes the post-slug name for a static page, the rewrite_rules are not properly refreshed. Consequently, permalinks for static pages will not work properly if the post-slug name is changed for an existing page. The workaround I used was to manually go into wp_options and delete the value for rewrite_rules and then regenerage the permalink structure using the admin control panel.

I opened a forum thread regarding this issue here:

http://wordpress.org/support/topic/77070?replies=3

Attachments (1)

2850.diff (586 bytes) - added by robmiller 20 years ago.

Download all attachments as: .zip

Change History (13)

#1 @darkfate
20 years ago

So we need to alter the rewrite column in the database when the post slug is changed. Right?

#2 @darkfate
20 years ago

Probably would be something like this:

UPDATE wp_options SET option_value = 'blahblablah' WHERE option_id =73 AND blog_id =0 AND option_name = 'rewrite_rules'

#3 @ryan
20 years ago

I can't reproduce this with 2.0.3. Changing the slug for any page correctly refreshes the rewrite rules. Using any plugins? Did you manually enable the cache?

@robmiller
20 years ago

#4 @robmiller
20 years ago

  • Keywords bg|has-patch added
  • Owner changed from anonymous to robmiller
  • Status changed from new to assigned

Won't this work - flushing the rewrite rules after the post is edited?

#5 @markjaquith
20 years ago

robmiller,

That's redundant. edit_post() calls wp_insert_post() which calls $wp_rewrite->flush_rules();

I don't see any reason this reported problem should be happening unless some plugin is interfering.

#6 @robmiller
20 years ago

Oops, my bad. If it's any consolation, I can't recreate the problem either.

#7 @darkfate
20 years ago

Could this be a permissions problem with his server? If it can't write the htaccess file, it won't work.

#8 @markjaquith
20 years ago

darkfate,
No, WordPress' rewrite rules are no longer stored in the .htaccess file. All that is there is a generic (unchanging) rule that points all requests to WP's internal rewriter.

#9 @meckhert
20 years ago

I'm not using any plugins that should cause a problem. You are testing with a static page and not a post, right?

It seems to work properly with posts, but not static pages.

#10 @markjaquith
20 years ago

You need to disable all your plugins, just to be sure.

#11 @ryan
19 years ago

  • Resolution set to worksforme
  • Status changed from assigned to closed

#12 @(none)
19 years ago

  • Milestone 2.0.4 deleted

Milestone 2.0.4 deleted

Note: See TracTickets for help on using tickets.