dsyo9700 2014-07-25 12:18
浏览 6

too long

My old urls may have one or more spaces in them. In the browser they appear as %20, which is also what google webmaster tools tell me. Recently I internally changed all dynamically generated urls so that they no longer generate spaces, but a plus-sign instead (+). The problem is with the large number of urls with space that has already been indexed by google and pals, which make them duplicate pages with same content.

I've also gone through zillions of related answers on SO, unfortunately nothing worked for me. This is the last htaccess rule I tried, before I gave up :

redirectMatch 301 /book_list.php?(.*)\s|%20(.*)$ http://www.example.com/book_list.php?$1+$2

But it doesnot lead to any re-direction. The address-bar still shows the url with the space or %20.

This are examples of sample urls which I would like to redirect:

The corresponding re-directions should be to : http://www.example.com/book_list.php?searchtype=author&search=John+Grisham and http://www.example.com/book_list.php?searchtype=title&search=Fire+in+the+Hall

I have added canonical url to all pages as the url+with+plus+sign, which hopefully should help a bit ...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 描述一下元器件的基本功能,pcba板的基本原理
    • ¥15 STM32无法向设备写入固件
    • ¥15 使用ESP8266连接阿里云出现问题
    • ¥15 BP神经网络控制倒立摆
    • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
    • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
    • ¥30 Unity接入微信SDK 无法开启摄像头
    • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan