title: PDF redirected to php file using htaccess—removed but still persists W3 total cache
body: <p>A previous developer created an entry into the htaccess of a worpress site in a few areas.</p>
  <ol>
  <li>In the root directory</li>
  <li>In the directory that contains wp-content etc.</li>
  </ol>
  <p>That rule is as follows:</p>
  <pre><code># RewriteCond %{REQUEST_URI} -f    
  # RewriteRule ^(.+)\.pdf$ download-protect.php?file=%{REQUEST_URI} [L,NC,QSA]
  # disable directory browsing in WordPress
  </code></pre>
  <p>As you can see they are both commented out, but the PDF is still redirected. So a few questions:</p>
  <p>Which directory .htaccess would this be best applied to?</p>
  <p>Why would PDF's still be redirected if this is commented out? No other trace of that rule anywhere else.</p>
  <p>Could it be W3 total cache?</p>
  <p>Some context is I need to fix this as it's going to http as opposed to https and the file itself basically says if logged in continue to PDF if not show &quot;must be logged in&quot; message.</p>
  <p><a href="https://bvfoods.com/new/wp-content/uploads/2018/06/90029-BV-WG-Cinnamon-Crumble-2.9-oz.pdf" rel="nofollow noreferrer">https://bvfoods.com/new/wp-content/uploads/2018/06/90029-BV-WG-Cinnamon-Crumble-2.9-oz.pdf</a></p>
  <p>Redirects to</p>
  <p><a href="http://bvfoods.com/new/download-protect.php?thisFile=2018/06/90029-BV-WG-Cinnamon-Crumble-2.9-oz.pdf" rel="nofollow noreferrer">http://bvfoods.com/new/download-protect.php?thisFile=2018/06/90029-BV-WG-Cinnamon-Crumble-2.9-oz.pdf</a></p>
  <p>which if logged in redirects back to the original PDF and if not it displays the must be logged in screen.</p>