Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WebFactory

    (@webfactory)

    Hi,
    I apologize for the delayed reply.

    At the moment we don’t have the option to ignore URL params, so each FB URL is considered unique and then redirects don’t work. We’re working on fixing that.

    Its an easy fix. Who can I submit my code changes to?
    I was hoping to checkout to SVN

        /**
         *
         * DO_REDIRECT
         *
         * This function will redirect the user if it can resolve that this url request has a redirect.
         *
         * @author epstudios
         *
         */
        public function do_redirect()
        {
          if (is_admin()) return false;
          $redirects = self::get_redirects(true); // True for only active redirects.
    
          if (empty($redirects)) return false; // No redirects.
    
          // Get current url
          $url_request = self::get_url();
          $url_request_path = strtok($url_request, '?');
    
          $query_string = explode('?', $url_request);
          $query_string = (isset($query_string[1])) ? $query_string[1] : false;
    
          foreach ($redirects as $redirect) {
            $from = urldecode($redirect->url_from);
    
            if ($redirect->status != 'inactive' && rtrim(trim($url_request_path), '/')  === self::format_from_url(trim($from))) {
    
              // Match, this needs to be redirected
              // increment this hit counter.
              self::increment_field($redirect->id, 'count');
    
              if ($redirect->status == '301') {
                header('HTTP/1.1 301 Moved Permanently');
              } elseif ($redirect->status == '302') {
                header('HTTP/1.1 302 Moved Temporarily');
              }
    
              $to = ($redirect->type == "url" && !is_numeric($redirect->url_to)) ? urldecode($redirect->url_to) : get_permalink($redirect->url_to);
              $to = ($query_string) ? $to . "?" . $query_string : $to;
    
              header('Location: ' . $to, true, (int)$redirect->status);
              exit();
            }
          }
        }
    Plugin Author WebFactory

    (@webfactory)

    @sithvicious thank you very much for your code contribution! SVN here on repo doesn’t allow that ?? but I’ll make sure we merge the change in the next release after our devs have a look.

    Again, thank you so much for helping out!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect not working’ is closed to new replies.