即使在实施重定向后,搜索引擎仍显示旧的 URL
Search engines are showing the old URL even after implementing a redirect
我只想知道我在 .htaccess 文件中使用什么代码进行 301 重定向。
我的旧 URL 是 http://www.mercurysolutions.co/training/certified-ethical-hacker-v9-course
,我想将其重定向到 http://www.mercurysolutions.co/ec-council/certified-ethical-hacker-v9-course
我已经在 app/.htaccess 和 app/webroot/.htaccess 中尝试了这段代码
Redirect 301 /training/certified-ethical-hacker-v9-course /ec-council/certified-ethical-hacker-v9-course
当我在与我公司网站相关的搜索引擎上搜索时,它显示旧的 URL 和 404 错误。但是如果我点击它,它会重定向到新的 URL.
RedirectMatch 301 ^/training/certified-ethical-hacker-v9-course /ec-council/certified-ethical-hacker-v9-course
这应该重定向您的页面。
搜索引擎是不同的东西。 Google 已将您的旧 link 编入索引,并在搜索引擎上搜索时显示您的旧 link。要从 Google WebMaster Tool 的 Google Index 中删除旧的 link 并且应该添加 410 Gone header 以便当 Google bot 爬行时它会注意到索引页面不见了。
我只想知道我在 .htaccess 文件中使用什么代码进行 301 重定向。
我的旧 URL 是 http://www.mercurysolutions.co/training/certified-ethical-hacker-v9-course
,我想将其重定向到 http://www.mercurysolutions.co/ec-council/certified-ethical-hacker-v9-course
我已经在 app/.htaccess 和 app/webroot/.htaccess 中尝试了这段代码
Redirect 301 /training/certified-ethical-hacker-v9-course /ec-council/certified-ethical-hacker-v9-course
当我在与我公司网站相关的搜索引擎上搜索时,它显示旧的 URL 和 404 错误。但是如果我点击它,它会重定向到新的 URL.
RedirectMatch 301 ^/training/certified-ethical-hacker-v9-course /ec-council/certified-ethical-hacker-v9-course
这应该重定向您的页面。
搜索引擎是不同的东西。 Google 已将您的旧 link 编入索引,并在搜索引擎上搜索时显示您的旧 link。要从 Google WebMaster Tool 的 Google Index 中删除旧的 link 并且应该添加 410 Gone header 以便当 Google bot 爬行时它会注意到索引页面不见了。