Redirect is not working with GET parameters
-
Redirect are not working if you have set redirect for url
/page/
and user will enter it e.g. from social sites with UTM tags/page/?utm_source=facebook&utm_term=example
Solutions would be to parse get parameters on line 215:
$userrequest = str_ireplace(get_option('home'),'',$this->get_address()); $get_parameters = substr($userrequest, strpos($userrequest, "?") + 1); $get_parameters = (!empty($get_parameters) ? '?'.$get_parameters : null); $userrequest = strtok($userrequest, '?'); $userrequest = rtrim($userrequest,'/');
and then add them in redirect:
elseif(urldecode($userrequest) == rtrim($storedrequest,'/')) { // simple comparison redirect $do_redirect = $destination.$get_parameters; }
However very nice and simple plugin!
- The topic ‘Redirect is not working with GET parameters’ is closed to new replies.