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 像这种代码要怎么跑起来?
  • ¥15 怎么改成循环输入删除(语言-c语言)
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理
  • ¥15 STM32无法向设备写入固件