regex – Plugin’s htaccess rewrite rule not working. Should catch PDF file requests and route to script

Question

I’ve installed a plugin that adds this top part to the htaccess file. The problem is the rewrite regex isn’t catching PDF requests like it should. The RewriteRule looks correct? But I’m not sure why it’s not matching the regex. Can anyone spot anything wrong with the regex below?

# BEGIN PDF Analytics
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.+).pdf$ /wp-content/plugins/pdf-analytics/tracking.php?file=$1.pdf [L,NC,QSA]
</IfModule>
# END PDF Analytics


# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Edit: I want to add that I put a die('here'); at the top of tracking.php, so I know if the file is being called or not. It’s not.

0
Gavin 3 weeks 2021-09-08T05:18:06-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse