由于您不必操作 URL,因此可以使用简单的Redirect:
Redirect /www.domain.com.au/campers-and-motorhomes/ne%20w-zealand/camper-rentals/ http://www.domain.com.au/campers-and-motorhomes/new-zealand/camper-rentals/
编辑如果 Apache 不喜欢未引用的空格%20
,请尝试用其中的真实空格引用整个内容:
Redirect "/www.domain.com.au/campers-and-motorhomes/ne w-zealand/camper-rentals/" http://www.domain.com.au/campers-and-motorhomes/new-zealand/camper-rentals/
Edit2如果要附加查询字符串,恐怕您需要使用 mod_rewrite 来摆脱查询字符串,而不是简单的重定向。
RewriteEngine On
# If the request starts with www.domain.com.au, it is the broken link
# Rewrite to the proper URL and put ? on the end to remove the query string
RewriteRule ^www\.domain\.com\.au http://www.domain.com.au/campers-and-motorhomes/new-zealand/camper-rentals/? [L,R=301]