Title: 302 Redirect loop
Last modified: February 7, 2021

---

# 302 Redirect loop

 *  Resolved [Gulshan Kumar](https://wordpress.org/support/users/thegulshankumar/)
 * (@thegulshankumar)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/302-redirect-loop-2/)
 * My plugin does redirect upon activation –
 *     ```
       register_activation_hook(__FILE__, 'example_plugin_activate');
       add_action('admin_init', 'example_plugin_redirect');
   
       function example_plugin_activate() {
       	add_option('example_plugin_do_activation_redirect', true);
       }
   
       function example_plugin_redirect() {
       	if (get_option('example_plugin_do_activation_redirect', false)) {
       		delete_option('example_plugin_do_activation_redirect');
       		if(!isset($_GET['activate-multi'])) {
        // This is path where I faced redirect loop
       			wp_redirect(admin_url( 'options-general.php?page=example' ));
       			exit();
       		}
       	}
       }
       ```
   
 * I use Redis where this example plugin is active.
 * In a rare instance, I have noticed 302 redirect loop
 * This was fixed when…
    1) I deactivated my example plugin 2) and flushed Redis
   cache. 3) tried activation, got redirected to settings page as expected. 4) I
   was able to repro this problem only where I use Redis, not at any non-Redis site.
   Means, normally it works in 99% cases.
 * Any ideas? Does Redis purge its cache upon any plugin activation?
 * Thanks

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

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/302-redirect-loop-2/#post-14015498)
 * It does not. It’s up to plugins (or your custom code) to handle cache flushing/
   deletions.
 *  Thread Starter [Gulshan Kumar](https://wordpress.org/support/users/thegulshankumar/)
 * (@thegulshankumar)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/302-redirect-loop-2/#post-14025646)
 * Okay, I will use `redis_object_cache_flush`

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

The topic ‘302 Redirect loop’ is closed to new replies.

 * ![](https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513)
 * [Redis Object Cache](https://wordpress.org/plugins/redis-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/redis-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/redis-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redis-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redis-cache/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Gulshan Kumar](https://wordpress.org/support/users/thegulshankumar/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/302-redirect-loop-2/#post-14025646)
 * Status: resolved