Redirects the user to the link.

@param string $slug
972727
public function redirect($slug)
    {
        if (! $link = Link::where('slug', $slug)->first()) {
            abort(404, 'Unable to find this link');
        }

        $link->addView();

        return redirect($link->url);
    }
133965
protected function fixSlug($slug)
    {
        $parts = explode('/', $slug);
        $slug = '';
        foreach ($parts as $part) {
            if ($part) {
                $slug .= '/'.str_slug($part);
            }
        }

        return strtolower('/'.ltrim($slug, '/'));
    }
847162
public function redirect()
    {
        $url = Common::getRequestVar('url', '', 'string', $_GET);
        if (!UrlHelper::isLookLikeUrl($url)) {
            die('Please check the &url= parameter: it should to be a valid URL');
        }
        // validate referrer
        $referrer = Url::getReferrer();
        if (empty($referrer) || !Url::isLocalUrl($referrer)) {
            die('Invalid Referrer detected - This means that your web browser is not sending the "Referrer URL" which is
				required to proceed with the redirect. Verify your browser settings and add-ons, to check why your browser
				 is not sending this referrer.

				<br/><br/>You can access the page at: ' . $url);
        }

        // mask visits to *.piwik.org
        if (!self::isPiwikUrl($url)) {
            Piwik::checkUserHasSomeViewAccess();
        }
        Common::sendHeader('Content-Type: text/html; charset=utf-8');
        echo '<html><head><meta http-equiv="refresh" content="0;url=' . $url . '" /></head></html>';

        exit;
    }
722515
public function redirect(string $url): void {
		if (!filter_var($url, FILTER_VALIDATE_URL)) {
			throw new ResponseException("Invalid URL: $url", ResponseException::INVALID_URL);
		}
		
		$this->setType("redirect");
		$this->data["url"] = $url;
	}
934433
function redirect($url, $type = 303) {
		if ($type === 303) {
			$this->http_response_code(303);
		}
		else if ($type == 301) {
			$this->http_response_code(301);
		}
		else if ($type == 307) {
			$this->http_response_code(307);
		}

		// redirect to...
		$this->header("Location: $url");
	}
942155
public function link($slug)
    {
        $link = Link::where('slug', $slug)->first();

        if (! $link) {
            abort(404, 'The link was not found');
        }

        return view('links::link', ['link' => $link]);
    }
799823
public function redirect($url)
    {
        $this->checkIfHeadersAlreadySent();
        $url = $this->di->get("url")->create($url);
        header('Location: ' . $url);
        exit();
    }
110046
public static function redirectToReferrer()
    {
        $referrer = self::getReferrer();
        if ($referrer !== false) {
            self::redirectToUrl($referrer);
        }
        self::redirectToUrl(self::getCurrentUrlWithoutQueryString());
    }
755857
public function deleteUserBySlug($slug)
    {
        $userToDelete = $this->getUserBySlug($slug);
        if (empty($userToDelete)) {
            throw new \Exception('Trying to delete a user that doesn\'t exist.');
        }
        $users = $this->getUsers();
        foreach ($users as $key => $user) {
            if ($user->slug == $userToDelete->slug) {
                unset($users[$key]);
                $this->repository->users = array_values($users);
            }
        }
        $this->save();
    }
407015
public function handle(): void
    {
        // Update slug for specific category
        if ($this->category) {
            $this->setCategoryFullSlug($this->category);
            return;
        }

        // Regenerate full slug for all categories
        $categories = Category::root()->get();

        $categories->each(function (Category $category) {
            $this->setCategoryFullSlug($category);
        });
    }
1359539
public static function redirect(string $to) {
		ref\sanitize::url($to);

		unset($_POST);
		unset($_GET);
		unset($_REQUEST);

		if (! \headers_sent()) {
			\header("Location: $to");
		}
		else {
			echo "<script>top.location.href='" . \str_replace("'", "\'", $to) . "';</script>";
		}
		exit;
	}
1256775
function redirect() {
            $host = $_SERVER['HTTP_HOST'];
            $uri = $_SERVER['PHP_SELF'];
            $location = $_SERVER['HTTPS'] ? 'https://' : 'http://';
            $location = $location . $host . $uri;
            $location = $this->addSession($location);
            header("Location: $location");
    }
1067914
function redirect($to) {

    if ($this->performed) {
      throw new Trails_DoubleRenderError();
    }

    $this->performed = TRUE;

    # get uri; keep absolute URIs
    $url = preg_match('#^(/|\w+://)#', $to)
           ? $to
           : $this->url_for($to);

    $this->response->add_header('Location', $url)->set_status(302);
  }
94025
public function redirect($url)
    {
        // has redirect from upstream
        if (($this->status === 301 || $this->status === 302) && ($this->hasHeader('location'))) {
            return;
        }
        // @fixme need a better solution
        $this->numRedirected--;
        $this->status = 302;
        $this->setHeader('location', $url);
    }
422493
public static function redirectTo($module, $controller = 'index', array $params = []): void
    {
        $url = Router::getFullUrl($module, $controller, $params);
        self::redirect($url);
    }
786348
public function redirect($url = null)
    {
        if (null === $url) {
            $url = $this->getServer('HTTP_ORIGIN');
        }
        ob_start();
        header('Location: ' . $url);
        ob_end_clean();
        Security::getInstance()->updateSession();
        exit(t('Redireccionando...'));
    }
323521
private function insertMenuObject($slug, $callback, $object)
    {
        $object->slug = $this->snakeName($slug);
        $object->menu = $this->getMenu();

        call_user_func($callback, $object);

        if (! $object->insert) {
            $this->links[] = $object;
        }
    }