PDF redirected to php file using htaccess—removed but still persists W3 total cache

83 Views Asked by At

A previous developer created an entry into the htaccess of a worpress site in a few areas.

  1. In the root directory
  2. In the directory that contains wp-content etc.

That rule is as follows:

# RewriteCond %{REQUEST_URI} -f    
# RewriteRule ^(.+)\.pdf$ download-protect.php?file=%{REQUEST_URI} [L,NC,QSA]
# disable directory browsing in WordPress

As you can see they are both commented out, but the PDF is still redirected. So a few questions:

Which directory .htaccess would this be best applied to?

Why would PDF's still be redirected if this is commented out? No other trace of that rule anywhere else.

Could it be W3 total cache?

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 "must be logged in" message.

https://bvfoods.com/new/wp-content/uploads/2018/06/90029-BV-WG-Cinnamon-Crumble-2.9-oz.pdf

Redirects to

http://bvfoods.com/new/download-protect.php?thisFile=2018/06/90029-BV-WG-Cinnamon-Crumble-2.9-oz.pdf

which if logged in redirects back to the original PDF and if not it displays the must be logged in screen.

0

There are 0 best solutions below