title: PHP Redirect, how to?
body: <p>For some reason one magento url is not working fine on my website.
  see here:
  <a href="https://stackoverflow.com/questions/13298533/integrity-constraint-violation-1052-column-position-in-order-clause-is-ambigu">Integrity constraint violation: 1052 Column &#39;position&#39; in order clause is ambiguous</a></p>
  
  <p>So, I decided that I could do a redirect for this failing url:
  I tried with apache but it doesnt work
  see here:
  <a href="https://stackoverflow.com/questions/13463282/apache-simple-redirect-from-one-page-to-a-second-one">Apache simple redirect from one page to a second one</a></p>
  
  <p>They suggested to do it with php</p>
  
  <p>can someone pls explain me how to do this with php?</p>
  
  <p>something like </p>
  
  <pre><code>if url = 'myfaliingurl' then
    redirect to new url
  </code></pre>
  
  <p>thats it</p>
  
  <p>this is what I tried in apache</p>
  
  <pre><code>Redirect 301 http://www.theprinterdepo.com/catalogsearch/result/index/?cat=100&amp;q=1022&amp;x=0&amp;y=0 http://www.theprinterdepo.com/catalogsearch/advanced/result/?name=1022&amp;sku=&amp;price%5Bfrom%5D=&amp;price%5Bto%5D=&amp;free_shipping=&amp;category=100
  </code></pre>
  
  <p><strong>Update 1:</strong></p>
  
  <p>Its not working, I put this on index.php at the end.</p>
  
  <pre><code>if($url == 'http://www.theprinterdepo.com/catalogsearch/result/index/?cat=100&amp;q=1022&amp;x=0&amp;y=0')
    {
            header('location:http://www.theprinterdepo.com/catalogsearch/result/index/?cat=100&amp;q=1022&amp;x=0&amp;y=0 http://www.theprinterdepo.com/catalogsearch/advanced/result/?name=1022&amp;sku=&amp;price%5Bfrom%5D=&amp;price%5Bto%5D=&amp;free_shipping=&amp;category=100');
            exit();
    }
  else
  {
  Mage::run('printerdepo','website');
  }
  </code></pre>