Currently I have this rewrite rule in place and it works great:
RewriteRule ^search/([^/]+)/? search.php?term=$1 [NC,QSA]
When I go to mysite.com/search/foo
it takes me to the proper search page for foo
. what I am looking to do is make the opposite work as well so that if I visit mysite.com/search.php?term=foo
I will be taken to mysite.com/search/foo
. I think I need a 301 redirect somewhere but I'm not sure how to do it without creating an infinite loop and the other posts I've read so far haven't been much help.