JApplication::redirect
Redirect to another URL.
Optionally enqueues a message in the system message queue (which will be displayed the next time a page is loaded) using the enqueueMessage method. If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" code in the header pointing to the new location. If the headers have already been sent this will be accomplished using a JavaScript statement.
Signature
public function redirect(string
$url,
[string
$msg = '',
[string
$msgType = 'message',
[boolean
$moved = false]]] )
Parameters
-
$url
- The URL to redirect to. Can only be http/https URL
-
$msg
- An optional message to display on redirect.
-
$msgType
- An optional message type. Defaults to message.
-
$moved
- True if the page is 301 Permanently Moved, otherwise 303 See Other is assumed.
Returns
- void
- Calls exit().