Procedural File: lib_redirects.php
Source Location: /_includes/lib_redirects.php
Page Details:
A library that contains everything related to the site's url redirect system. The system maps incoming urls to actual files on the server. It allows the site to show one structure to the outside while in reality using a completly different structure on the server.
Tags:
Includes:
buildUrlAliases [line 149]
Rebuilds the url aliases master table. It composes all necessary aliases and resets the aliases master table with that info.
Tags:
buildUrlRedirects [line 394]
void buildUrlRedirects(
)
|
|
Rebuilds the url redirects master table. It composes all necessary redirects and resets the redirects master table with that info.
Tags:
doDelayedRedirect [line 513]
void doDelayedRedirect(
string $url, [integer $delay = 2])
|
|
Performs a delayed redirection to the specified url with the speicified delay. The page will be redirected after the specified number of seconds have elapsed.
Tags:
Parameters
| string |
$url |
The url to the site that the user should be taken to. |
| integer |
$delay |
The number of seconds that the redirection should be delayed. |
doPermanentRedirect [line 526]
void doPermanentRedirect(
string $destinationUrl)
|
|
Redirects the request to a specified page with a permanent redirect, i.e. with a status code 301. The redirects is performed immedientally without delay and is done via the header sent in response to the request.
Parameters
| string |
$destinationUrl |
The url to which the user should be redirected. The url should be relative to the page root, relative to the web root or be absolute, starting with http://. |
doRedirect [line 538]
void doRedirect(
string $destinationUrl)
|
|
Redirects the url to the specified page with a temporary redirect, i.e. a redirect that should not be considered to be permanent by the client.
Parameters
| string |
$destinationUrl |
The url to which the user should be redirected. The url should be relative to the page root, relative to the web root or be absolute, starting with http://. |
getRealUrl [line 122]
string getRealUrl(
string $requestedUrl)
|
|
Gets the url that a specified url really leads to. For instance a user might request one url while the request is actually transferred to an centralised module behind the scenes.
Tags:
Parameters
| string |
$requestedUrl |
The url, relative to the site's root, which has been requested by the user (no query string). |
getRedirect [line 97]
string getRedirect(
string $requestedUrl)
|
|
Gets any redirects that apply to a specified url.
Tags:
Parameters
| string |
$requestedUrl |
The url, relative to the site's root, which has been requested by the user (no query string). |
getSimilarUrls [line 480]
array getSimilarUrls(
string $url)
|
|
Gets all urls that are similar to a specified url. I.e. all urls that exist and are subsets of the specified url.
Tags:
Parameters
| string |
$url |
The url, relative to the page root, for which all similar urls should be found. No query string is allowed. |
getUrlPath [line 46]
string getUrlPath(
string $url, [boolean $jump = true])
|
|
Attempts to get a url path to an existing file by starting from a specified url and then translating the related redirects.
Tags:
Parameters
| string |
$url |
The url, relative to the page root, that the search should start from. |
| boolean |
$jump |
Whether or not redirects should be followed. I.e. whether or not jumps should be executed. True if jumps should be executed, false otherwise. |
stripQueryString [line 29]
string stripQueryString(
string $url)
|
|
Strips an url of any query string (if one exists).
Tags:
Parameters
| string |
$url |
The url which's query string should be removed. |
stripRootPath [line 553]
string stripRootPath(
string $url)
|
|
Strips the root path from a specified url.
Tags:
Parameters
| string |
$url |
The url from which the root path should be stripped. |
|
|