Support » Plugin: Redirectioner » Query arg is removed

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is a major bug. It should respect the query_vars filter!

    I’ve created a workaround class, which can be copied into functions.php:

    class Bypass404Redirect {
    	function __construct(){
    		add_action('template_redirect', array($this, 'strip'), 9);
    		add_action('template_redirect', array($this, 'restore'), 11);
    	}
    	private $uri = '';
    
    	function strip(){
    		$this->uri = $_SERVER['REQUEST_URI'];
    		$_SERVER['REQUEST_URI'] = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
    	}
    
    	function restore(){
    		$_SERVER['REQUEST_URI'] = $this->uri;
    	}
    }
    new Bypass404Redirect();
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Query arg is removed’ is closed to new replies.