The solution is called URL-encoding.
Regardless of their content, you're supposed to always URL-encode the individual request parameter name and value. Ultimately, your URL should end up looking like this, when using UTF-8 charset during encoding:
http://www.portal.mywebsite.com/res_a/res_b?orig=http%3A%2F%2Fmyorigin.com%2Ftest1%2Ftest2%3Fq1%3Dv1%26q2%3Dv2
Every self-respected programming language has an API for this job. Based on your question history, you're familiar with Java, so here's a related question with a Java based example in the answer: Java URL encoding of query string parameters. For other languages, just search around using the additional keywords "URL encoding".