Once it all works, replace 302 with 301 (browsers cache 301 so it’s very hard to test rules with 301, but they don’t cache 302, so it’s easier to test with that).
Thanks for reply, I try to copy the above code and paste into htaccess but it is not working, getting 404 error instead. I try with 301 too but no luck.