RewriteCond %{REQUEST_FILENAME} !-d # not a dir RewriteCond %{REQUEST_FILENAME} !-f # not a file RewriteRule ^.*\.pdf$ https://trokentech.pl%{REQUEST_URI} [R=301,NC]