ashish2005 - 11:03 am on Jul 5, 2013 (gmt 0)
don't quit so easily or you have wasted my time, lucy24's time and g1smd's time.
Thank you for saying that. I definitely do not want to have wasted time of anyone. So I am giving this another go.
1. get rid of the 301 and leading slash
2. replace it with a ^ which is a start anchor
3. get rid of the ? in the character group
4. escape the literal period with a backslash
5. add a $ to the end of the pattern which is an end anchor
6. add a ? after the substitution string so the query string doesn't pass through to the redirected url.
I tried what you said and if I am correct after modification, this is what becomes of my code
RewriteRule ^play-([0-9a-zA-Z-]+)-online-([0-9]+)\.html$ http://www.example.com/online-games/$1.html? [L,R=301]
And now to my delight it works perfectly just like I wanted it to. Almost gave up. Thanks for everything.