使用regexp自定义htaccess 301重定向

使用regexp自定义htaccess 301重定向,regex,http-status-code-301,Regex,Http Status Code 301,我想从源url移动页面: http://mysite.fr/topic/15530-fermeture-de-lapplication-sur-run/ 要设置目标url,请执行以下操作: http://mysite.fr/index.php?p=discussion/15530/fermeture-de-lapplication-sur-run/ 我试过了,但没有成功: RedirectMatch 301 ^/topic/([0-9]+)-(.+?)$ /index.php?p=discu

我想从源url移动页面:

http://mysite.fr/topic/15530-fermeture-de-lapplication-sur-run/
要设置目标url,请执行以下操作:

http://mysite.fr/index.php?p=discussion/15530/fermeture-de-lapplication-sur-run/
我试过了,但没有成功:

RedirectMatch 301 ^/topic/([0-9]+)-(.+?)$ /index.php?p=discussion/$1/$2
我错过了什么? 提前谢谢

有关信息,此原始重定向正在工作:

Redirect 301 /topic/15530-fermeture-de-lapplication-sur-run/ /index.php?p=discussion/15530/fermeture-de-lapplication-sur-run/
试试这个:

RedirectMatch 301 ^/topic/([0-9]+)-([^/]+/)$