Title: Flush Rewrite Rules code correction
Last modified: August 21, 2016

---

# Flush Rewrite Rules code correction

 *  Resolved [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/flush-rewrite-rules-code-correction/)
 * This needs to be fixed. Thanks.
 * By doing this generalized check for if any plugin saves its settings you wipe
   out/delete the root .htaccess file code whenever ANY plugin settings are saved.
   Typically flush rewrite rules should ONLY be used on plugin activation and deactivation.
   Please correct this. Thank you.
 *     ```
       // Init stuff
               function init() {
                   if ('true' == @$_REQUEST['settings-updated']) {
                       global $wp_rewrite;
       				$wp_rewrite->flush_rules();
                   }
               }
       ```
   
 * [http://wordpress.org/plugins/aspexi-easy-login-url/](http://wordpress.org/plugins/aspexi-easy-login-url/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [tripflex](https://wordpress.org/support/users/tripflex/)
 * (@tripflex)
 * [12 years ago](https://wordpress.org/support/topic/flush-rewrite-rules-code-correction/#post-4126700)
 * I agree, I just spent hours trying to figure out the problem just to locate it
   down to this plugin. This plugin should pretty much be removed from the repo!
   Like whoa! Completely incorrect way of flushing rewrite rules!
 *  Thread Starter [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years ago](https://wordpress.org/support/topic/flush-rewrite-rules-code-correction/#post-4126701)
 * Yep, this plugin appears to be abandoned. There is a great alternative plugin
   that does this: [http://wordpress.org/plugins/stealth-login-page/](http://wordpress.org/plugins/stealth-login-page/)
 *  [tripflex](https://wordpress.org/support/users/tripflex/)
 * (@tripflex)
 * [12 years ago](https://wordpress.org/support/topic/flush-rewrite-rules-code-correction/#post-4126702)
 * I actually integrated this functionality into a plugin i’m creating, if you’re
   interested in it:
 * [https://github.com/tripflex/user-activate-by-reset](https://github.com/tripflex/user-activate-by-reset)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Flush Rewrite Rules code correction’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/aspexi-easy-login-url.svg)
 * [Aspexi Easy Login URL](https://wordpress.org/plugins/aspexi-easy-login-url/)
 * [Support Threads](https://wordpress.org/support/plugin/aspexi-easy-login-url/)
 * [Active Topics](https://wordpress.org/support/plugin/aspexi-easy-login-url/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/aspexi-easy-login-url/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/aspexi-easy-login-url/reviews/)

## Tags

 * [rewrite rules](https://wordpress.org/support/topic-tag/rewrite-rules/)

 * 3 replies
 * 2 participants
 * Last reply from: [tripflex](https://wordpress.org/support/users/tripflex/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/flush-rewrite-rules-code-correction/#post-4126702)
 * Status: resolved