我写了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/manchester/character-bedding.html?size=275x275&helper=1281395930.79
........ 我需要重定向 http://www.thebedroom.com.au/manchester/character-bedding.html
答案 0 :(得分:1)
从您的Redirect指令中删除查询字符串,这就是您所拥有的:(确保一直向右滚动以查看注释)
# 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
不确定为什么它会起作用,但你需要删除所有 AFTER ?
,然后将?
移到那里。这确实有一个流浪问号的难看的副作用,但你可以使用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]