我写
<?
header("Location:http://example.com");
?>
Run Code Online (Sandbox Code Playgroud)
但没有发生重定向.如何重定向?
但是我没有权限编辑php.ini所以在php.ini中启用了safe_mode
尝试:
header("Location: http://example.com");
Run Code Online (Sandbox Code Playgroud)
HTTP标头需要完全遵循规范.更直接在这里(位置标题):
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30