• Resolved samkallkwik

    (@samkallkwik)


    Hi

    I have just installed this onto my site and can’t seem to get it to work. After installing, I have gone to the media library and protected a pdf file. When I try to directly access that file in private I can’t access it, which is great. But then when logged in as an administrator, or trying to access the file via some content on a page, I get the same 400 ‘Not found’ error. Am I missing something? I am running on Apache with PHP 8.3.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Muhammad

    (@muhammadwpfolio)

    Hi @samkallkwik,

    Thank you for reaching out to us.

    It seems our custom rewrite rules are not inserted into your .htaccess file properly.

    To get the exact rewrite rules, please navigate to Prevent Direct Access Gold > Settings > Helpers tab.

    You can follow our instructions there to add these rules to your .htaccess file.

    Please refer to our documentation here for more information: https://preventdirectaccess.com/docs/pda-rewrite-rules/

    If you need any further assistance, let us know.

    Thread Starter samkallkwik

    (@samkallkwik)

    Hi

    We are just using the free version of the plugin at the moment to see how it works.

    I have had a look at the .htaccess file and here is what is there between the wordpress tags:

    # 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.
    # Prevent Direct Access Rewrite Rules
    RewriteRule private/([a-zA-Z0-9]+)$ index.php?pda_v3_pf=$1 [L]
    RewriteCond %{REQUEST_FILENAME} -s
    RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]
    RewriteCond %{HTTP_USER_AGENT} !Twitterbot/[0-9]
    RewriteCond %{HTTP_USER_AGENT} !Googlebot/[0-9]
    RewriteRule wp-content/uploads/_pda(\/[A-Za-z0-9_@.\/&+-]+)+\.([A-Za-z0-9_@.\/&+-]+)$ index.php?pda_v3_pf=$1&is_direct_access=true&file_type=$2 [QSA,L]
    # Prevent Direct Access Rewrite Rules End

    <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

    So it looks like its inserted some rules. I have tried disabling my cache and still no access.

    Thanks

    Plugin Support Quinnie

    (@quinniewpfolio)

    Hi @samkallkwik,

    Thank you for the information.

    Could you please provide us with a sample protected URL so we can take a closer look?

    Additionally, may I ask which hosting server and caching service you’re currently using?

    Awaiting your reply.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘No file access’ is closed to new replies.