Redirect duplicate URLs using htaccess

advertisements

i need help with htaccess advanced redirect. Like i have some pages in my blog,

URL example site.com/en/post-detail/90

User can access same page by link

 site.com/en/post-detail/90/(anything after slash)

so i want to redirect all requests like

 site.com/en/post-detail/90/(anything) to site.com/en/post-detail/90.

/en/ - is various, it can be Ru, pt, it, fr etc.
/90/ - is the id of post, so it is always numbers


Try :

RedirectMatch 301 ^/((en|ru|pt|it|fr)/post-detail/([0-9]+))/.+$ /$1