.htaccess使用RedirectMatch重写

时间:2014-12-25 13:33:27

标签: apache .htaccess redirect

我需要将多个网址重定向到一个 来自     1.example.com/groups/3d/
    2.example.com/groups/3d/skype:softlist_ua?chat
    3.example.com/groups/3d/+/
    4.example.com/groups/3d/+/+/
    5.example.com/groups/3d/+/skype:softlist_ua?chat


example.com/catalog/3d /

Redirect语句工作正常,但是当旧的URL包含获得reuqests时,它会将此get请求添加到新URL的末尾。我该如何删除它?

RedirectMatch 301 ^ / groups / 3d /.*$ / catalog / 3d / $ 1

1 个答案:

答案 0 :(得分:0)

尝试:

RedirectMatch 301 ^/groups/3d/.*$ /catalog/3d/?

RewriteEngine On
RewriteRUle ^groups/3d/ /catalog/3d/? [L,R=301]