php - 使用 PHP 进行 SEO URL 重定向

标签 php redirect seo

我想知道什么是最好的 SEO 重定向,301 还是 302?

我想将一些 URL 重定向到 PayPal 购买页面,301 或 302 哪个最好?

例如:

I want to redirect this link:
    http://example.com/?product_id=123
To PayPal purchase page:
https://www.paypal.com/xxxxxxxxetc...

301 还是 302?

谢谢。

最佳答案

规则已更改(至少对 Google 而言)

以前是301重定向,但是Google的John Mueller announced在 2016 年 2 月,这不再重要了:

Do I lose "link juice" from the redirects?

No, for 301 or 302 redirects from HTTP to HTTPS no PageRank is lost.

那我应该用什么?

由于 SEO 无关紧要,您应该使用宣传的 HTTP 代码:

  • 301 用于永久重定向

  • 302 用于临时重定向

有关更多信息,请访问 redirection rules for seo 上的 moz.com您还可以在哪里找到这张图片

enter image description here

关于php - 使用 PHP 进行 SEO URL 重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39423569/

相关文章:

php - 通过标签查找相关项目

php - 如何列出林中的所有域?

PHP 的 array_rand() 不是真正随机的?

php mysql错误处理显示在错误页面的错误中

html - 我应该为 SEO 动态更改图像的标题/替代标签吗?

javascript - (PHP) 克隆按钮上的按钮单击计数器

ruby-on-rails - 使用 OpenUri,如何获取重定向页面的内容?

c# - session 超时后如何重定向到主页

zend-framework - Zend 框架 1 和 2 : Get individual headMeta() values

magento - 如何将规范标签添加到 Magento 中的页面?