Htaccess does not redirect dynamic part in url

I'm trying to redirect the following url:
http://mydomain.com/samples_gallery.php?browse_by=subject&detail=11 to this one:
http://mydomain.com/gallery/subject/babies-kids

With the following code:
RewriteRule ^samples_gallery.php$ /gallery/subject [L,R=301]
RewriteCond %{QUERY_STRING} ^browse_by=subject&detail=11$

However, when done, I get the following url in response:
http://mydomain.com/gallery/subject/babies-kids?browse_by=subject&detail=11

How to I make the condition to eliminate the dynamic part?
poemorellaAsked:
Who is Participating?
 
rjdownCommented:
Just put a question mark on the end of the URL you're redirecting to e.g. /gallery/subject?
0
 
poemorellaAuthor Commented:
That worked great. Many thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.