dongpeiwei8589 2011-11-21 10:00
浏览 60
已采纳

为什么这个wordpress网站在Chrome中重定向错误?

Google has indexed this page http://[site-removed]/showering-accessories on my client's site which doesn't actually exist. The correct URL should be http://[site-removed]/products-page/showering-accessories

I don't want the site to be penalised in Google, So I've added this rule in .htaccess in the root of the site:

RedirectMatch 302 ^/showering-accessories /products-page/showering-accessories

(Note: I had been experimenting with 301 redirects previously)

This works as intended in IE and Firefox, but in Chrome I end up at this page, due to what I assume is a wordpress application-level (PHP) redirect:

http://[site-removed]/products-page/products

Why is this? Shouldn't the .htaccess rules always kick in before it reaches the PHP code? How can I fix it?

BTW I also have these rules below the RedirectMatch:

# Redirect all pages to subdirectory /new
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} /
RewriteRule ^(.*)$ /new/$1 [L,QSA]
  • 写回答

1条回答 默认 最新

  • doujiang2020 2011-11-21 10:33
    关注

    That redirect works fine for me when I use chrome. Are you sure your Chrome doesn't have an old redirect cached or something?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog