Redirect different options for 301

时间:2019-03-19 14:41:54

标签: php url-redirection http-status-code-301

in different post I readed these two options to redirect 301 using php.

What I was not able to identified which is the difference between both and which might be the better or pros and cons.

In a large webite I used the first one but we have some doubts due that the robots seems not to take in account the Permanent movement to the new direction .

Thanks in advance !!

Option 1 ( the one that I used )

header('Status: 301 Moved Permanently', false, 301);
header("Location: http://example.com/myOtherPage.php");
die();

Option 2

header("Location: http://example.com/myOtherPage.php",false,301);
die();

Thanks in advance Sergio

0 个答案:

没有答案