Unix and Linux Discussions Tagged with redirect |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
2 |
71,897 |
Shell Programming and Scripting |
|
|
|
14 |
13,429 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
13,974 |
Shell Programming and Scripting |
|
|
|
0 |
24,689 |
Web Development |
|
|
|
6 |
4,520 |
Shell Programming and Scripting |
|
|
|
1 |
1,867 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
4,136 |
Shell Programming and Scripting |
|
|
|
0 |
2,617 |
Web Development |
|
|
|
5 |
4,598 |
Shell Programming and Scripting |
|
|
|
4 |
19,392 |
Shell Programming and Scripting |
|
|
|
2 |
51,024 |
Shell Programming and Scripting |
|
|
|
3 |
2,338 |
Shell Programming and Scripting |
|
|
|
3 |
8,142 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,850 |
Emergency UNIX and Linux Support |
|
|
|
8 |
9,232 |
Shell Programming and Scripting |
|
|
|
3 |
8,375 |
Shell Programming and Scripting |
|
|
|
3 |
10,197 |
Shell Programming and Scripting |
|
|
|
5 |
4,127 |
Shell Programming and Scripting |
|
|
|
2 |
7,266 |
Shell Programming and Scripting |
|
|
|
0 |
2,914 |
Web Development |
|
|
|
12 |
22,045 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
4,697 |
Web Development |
|
|
|
3 |
17,301 |
Shell Programming and Scripting |
|
|
|
1 |
3,795 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
4,451 |
Solaris |
|
|
|
5 |
12,600 |
Shell Programming and Scripting |
|
|
|
2 |
7,420 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
7,330 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,176 |
Linux |
|
|
|
8 |
23,997 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
6,667 |
Web Development |
|
|
|
4 |
9,895 |
Shell Programming and Scripting |
|
|
|
3 |
5,589 |
Shell Programming and Scripting |
|
|
|
7 |
30,074 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,726 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
16,580 |
Programming |
|
|
|
5 |
14,746 |
Shell Programming and Scripting |
|
|
|
6 |
94,953 |
Shell Programming and Scripting |
|
|
|
4 |
9,000 |
IP Networking |
|
|
|
2 |
11,238 |
AIX |
HTTP_REDIRECT(3) 1 HTTP_REDIRECT(3)
http_redirect - Issue HTTP redirect
SYNOPSIS
bool http_redirect ([string $url], [array $params], [bool $session = false], [int $status])
DESCRIPTION
Redirect to the given url.
The supplied $url will be expanded with http_build_url(3), the $params array will be treated with http_build_str(3) and the session iden-
tification will be appended if $session is true. The HTTP response code will be set according to $status. You can use one of the redirect
constants for convenience. Please see RFC 2616 for which redirect response code to use in which situation. By default PHP will decide which
response status fits best.
To be RFC compliant, "Redirecting to <a>URL</a>." will be displayed, if the client doesn't redirect immediately, and the request method
was another one than HEAD.
A log entry will be written to the redirect log, if the INI settinghttp.log.redirect is set and the redirect attempt was successful.
PARAMETERS
o $url
- the URL to redirect to
o $params
- associative array of query parameters
o $session
- whether to append session information
o $status
- custom response status code
RETURN VALUES
Returns FALSE or exits on success with the specified redirection status code. See the INI settinghttp.force_exit for what "exits" means.
EXAMPLES
Example #1
A http_redirect(3) example
<?php
http_redirect("relpath", array("name" => "value"), true, HTTP_REDIRECT_PERM);
?>
The above example will output:
HTTP/1.1 301 Moved Permanently
X-Powered-By: PHP/5.2.2
Content-Type: text/html
Location: http://www.example.com/curdir/relpath?name=value&PHPSESSID=abc
Redirecting to <a href="http://www.example.com/curdir/relpath?name=value&PHPSESSID=abc">http://www.example.com/curdir/relpath?name=value&PHPSESSID=abc</a>.
SEE ALSO
the HttpResponse class if you are using PHP 5.1.0 and above.
PHP Documentation Group HTTP_REDIRECT(3)