title: Passing URL with htaccess
body: <p>htaccess below diverts PDF calls to <em>validate.php</em> where name of the PDF is get with <code>$_GET['filename']</code></p>
  
  <p>Problem is, it works with URLs below but it doesn't when there are many sub directories so what I need is, instead of just getting name of the file, I should pass whole URL to validation.php something like <code>^(.*)$ /validate.php?request_url=$1 [L]</code> (<em>this is just an example</em>).</p>
  
  <p><strong>Note:</strong> instead of whole URL, anything after domain is acceptable.</p>
  
  <p><strong>WORKS:</strong></p>
  
  <pre><code>http://www.whatever.com/1.pdf
  http://www.whatever.com/2.pdf
  http://www.whatever.com/3.pdf
  </code></pre>
  
  <p><strong>WON'T WORK:</strong></p>
  
  <pre><code>http://www.whatever.com/sub1/1.pdf
  http://www.whatever.com/sub1/sub2/1.pdf
  http://www.whatever.com/sub1/sub2/sub3/1.pdf
  </code></pre>
  
  <p>How can I do it?</p>
  
  <p>Thanks</p>
  
  <p><strong>CURRENT HTACCESS:</strong></p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{REQUEST_URI} \.(pdf)$ [NC]
  RewriteRule ^(.*)$ /validate.php?filename=$1 [L]
  </code></pre>
  
  <p><strong>CURRENT VALIDATION.PHP</strong></p>
  
  <pre><code>if (isset($_GET['filename']))
  {
     //Do something with it
  }
  else
  {
     //Don't do anything
  }
  </code></pre>