1

我写301重定向如下

Redirect 301 /catalogue/novelty_linen_q_t/spongebob_squarepants/spongebob_squarepants_quilt_cover_wonderland/image/?size=275x275&helper=1281395930.79 http://www.thebedroom.com.au/manchester/character-bedding.html?size=275x275&helper=1281395930.79

但是当我去 http://www.thebedroom.com.au/catalogue/novelty_linen_q_t/spongebob_squarepants/spongebob_squarepants_quilt_cover_wonderland/image/?size=275x275&helper=1281395930.79

它重定向 http://www.thebedroom.com.au/manchester/character-bedding.html?size=275x275&helper=1281395930.79

........我需要重定向 http://www.thebedroom.com.au/manchester/character-bedding.html

4

1 回答 1

1

从您的重定向指令中删除查询字符串,这就是您所拥有的:(确保一直滚动到右侧以查看评论)

#                                                                                                                           This question mark right here is why you have a query string in your redirect ---------v
Redirect 301 /catalogue/novelty_linen_q_t/spongebob_squarepants/spongebob_squarepants_quilt_cover_wonderland/image/?size=275x275&helper=1281395930.79 http://www.thebedroom.com.au/manchester/character-bedding.html?size=275x275&helper=1281395930.79

不太确定它为什么会起作用,但是您需要在之后删除所有内容,然后?将其?留在那里。这确实具有杂散问号的难看副作用,但您可以使用 mod_rewrite 摆脱它,将其替换为Redirect

RewriteEngine On
RewriteRule ^catalogue/novelty_linen_q_t/spongebob_squarepants/spongebob_squarepants_quilt_cover_wonderland/image/?$ /manchester/character-bedding.html? [L,R=301]
于 2012-08-21T19:49:34.637 回答