Support » Plugin: Simple 301 Redirects » [Plugin: Simple 301 Redirects] Ignore Get Parameters

  • The redirect function should ignore the Get Parameters. Right now it doesn’t, so URLs which have get parameters like the google analytics parameters – utm_source, utm_target, don’t get redirected

    I added a couple lines to the redirect function to fix it.

    function redirect()
        {
          // this is what the user asked for (strip out home portion, case insensitive)
          $userrequest = str_ireplace(get_option('home'),'',$this->getAddress());
          $userreqarray = explode('?', $userrequest);
          $userrequest = $userreqarray[0];
          $userrequest = rtrim($userrequest,'/');

    Thanks for the plugin 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Scott Nelle

    (@scottnelle)

    I appreciate the suggestion. I’m not sure I should implement it, though. My reasoning is that a fairly common use case for this plugin may be when someone started blogging using the default permalink settings (/?p=123) and later upgraded to better permalinks when they learned about the SEO benefits. Stripping out the query string would prevent the plugin from working for people in this situation.

    Thanks for the suggestion, though. I may add it as an option because I can imagine a lot of cases where it would be very useful.

    Agree about the permalink scenario, would be glad if you can add it as an option though, so that I/others don’t have to hack the plugin code everytime you upgrade the plugin 🙂

    Also it would be nice to be able to add more than one redirect at a time. A little cumbersome to add one, submit, wait, add another .. 🙂

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Simple 301 Redirects] Ignore Get Parameters’ is closed to new replies.