将旧网址重定向到新网址

时间:2014-07-16 08:54:48

标签: apache .htaccess

我想重定向

domain.com/games-10/my-game to domain.com
domain.com/games-10/yours-game to domain.com
domain.com/games-10/his-game to domain.com

我试过了:

Rewriterule ^games-10/(.*)$ http://domain.com$1 [r=301, L]
RewriteRule ^games-10/([^/]+)/?$ http://domain.com [R=301, L]

没有运气。

1 个答案:

答案 0 :(得分:1)

这应该完全有效:)

RewriteEngine On
RewriteRule ^games-10/.*$ http://domain.com [R=301,L]