Why doesn't this redirect work?
Why doesn't this redirect work?
$menu = 'menu';
$item = 'item';
header('HTTP/1.1 303 See Othe开发者_开发知识库r');
header("/{$menu}/{$item}/");
Because you forgot to specify which header you're sending.
Redirect headers need to start with Location:
.
header("Location: /{$menu}/{$item}/");
You need to do header("Location: /{$menu}/{$item}/");
See the example at HTTP 303 Wikipedia Page
Server response:
HTTP/1.1 303 See Other
Location: http://example.org/
精彩评论