title: How to Redirect in PHP to same page, but without certain parameters?
body: <p>Say my visitor arrive to:</p>
  
  <p><code>mydomain.com/nice-url/?p1=a&amp;p2=b</code></p>
  
  <p>I want them to be redirected to:</p>
  
  <p><code>mydomain.com/nice-url/?p1=a</code></p>
  
  <p>(probably with <code>header("Location:</code>)</p>
  
  <p>So I want to strip of the <code>p2=b</code> string.</p>
  
  <p>Since this is just an example, and there might be many other parameters, I'm looking for smartest solution, including ways to:</p>
  
  <ol>
  <li>Strip anything that starts with <code>p2</code>.</li>
  <li>Strip anything that doesn't start with <code>p1</code></li>
  </ol>
  
  <p>Keep in mind too that <code>nice-url</code> also can be various things such as:</p>
  
  <p><code>name-number-one</code>, <code>name-number-two</code>, etc.</p>
  
  <p>Also, I don't look for <code>.htaccess</code> solution, since I want to store in a session the values of the stripped parameters.</p>