开发者

Redirect Match 301 .htaccess Issue

Ok, so we are using vBulletin..ya I know. Which is within our Kohana based syste开发者_如何学Gom. The breakdown is as follows.

This is how vBulletin marks its member URL's http://server.com/forum/member.php?21148-username

I need to redirect them to this. http://server.com/member_profile/view/vb/21148

In my .htaccess I have this rule

RedirectMatch 301 /forum/member.php(.*) /member_profile/view/vb/$1

End Result: http://server.com/member_profile/view/vb/?21148-username

It has a ? and i need to remove -username

I've tried several variations using $2 and so on, but it doesn't seem to work with RedirectMatch.

Any help is much appreciated.


You need a bit more in your .htaccess to accomplish this. Something like this ought to do the trick:

RewriteCond %{QUERY_STRING} ^([0-9]+)\-.*$
RewriteRule ^forum/member.php$ /member_profile/view/vb/%1? [R=301,L]

That will take: http://server.com/forum/member.php?21148-username

and return: http://server.com/member_profile/view/vb/21148

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜