将RedirectMatch转换为mod_rewrite cond / rules

时间:2014-05-21 15:41:07

标签: apache .htaccess mod-rewrite

我需要将两个RedirectMatch规则转换为使用mod_rewrite。

以下是条件:

RedirectMatch ^/rw/[0-9][0-9][0-9][0-9]/[0-9][0-9]/(.+) http://www.example.com/rw/$1 
RedirectMatch ^/rw/category/(.+) http://www.example.com/rw/$2

复制这些规则的RewriteCond / RewriteRule语句是什么?

1 个答案:

答案 0 :(得分:0)

尝试:

RewriteEngine On

RewriteRule ^rw/[0-9][0-9][0-9][0-9]/[0-9][0-9]/(.+) http://www.example.com/rw/$1 [L,R]
RewriteRule ^rw/category/(.+) http://www.example.com/rw/$2 [L,R]