I need to match the URL format and depends on URL matches need to redirect the incoming requests to different pages.
For example
http://www.domain.com/path1/path2/ wrong-url -1/ ?var1=val1
http://www.domain.com/path1/path2/ another-wrong-url -1/ ?var1=val1
http://www.domain.com/path1/path2/ third-wrong-url -1/?var1=val1
http://www.domain.com/path1/path2/ fourth-wrong-url -1/?var1=val1
See the High lighted URL Matches. It always having -1 as the url string. . That needs to be redirected one static page.
And some other URL's always have var1 as URL Query String parameter. So if URL have var1 as Query string then those URL's needs to be redirected to another Static page.
So i tried this but didn't worked. Please help me in this redirecting script
RewriteEngine on
RewriteRule ^(path1/path2/[^-1]*)$ http://www.domain.com/target-page [L,R=301]