Passing parameter from the current URL to redirect to another url

This worked perfectly for me! The goal was to get a button that would filter my search results by post category and the above solution works exactly how I wanted it to.