Quote Originally Posted by carlwhat View Post
@lat9

in commit #42, in the usu class, it seems you have deleted line 100 which had the following code:

PHP Code:
// Determine canonical (if needed)
        
$this->canonical(); 
was this on purpose?

in my testing, this changes causes the automatic redirects to not happen.

now, whether that line of code is pertinent to the original redirect problem, i can not say, as i did not reproduce the original error.

john,
what happens if you add that line back?

starting at line 94 of includes/classes/usu.php, make it look like so:

PHP Code:
            } elseif (IS_ADMIN_FLAG) { is was is causing the
                
// Message Stack will be available when loaded from the admin
                
$GLOBALS['messageStack']->add(sprintf(USU_PLUGIN_WARNING_TABLETABLE_USU_CACHE), 'warning');
            }
        }

        
// Determine canonical (if needed)
        
$this->canonical();

        
// Start logging
        
$this->debug false;
        if (
defined('USU_DEBUG') && USU_DEBUG == 'true') { 
does this fix your redirect as well as preserve the fix to your original problem?
Can confirm that if this line is added back in, it fixes the 301 redirects for products that exist but introduces back the redirection loop for deleted products. You can test it yourself, visit a product on your website & add a few numbers to the product id to create a product that doesn't exist. With that line added back, you will/should get the redirection loop. Without that line the loop is fixed, but the 301's are broken for canonicals.