• Hello
    Nearly month ago we moved our site from share hosting to vds server. After that we can’t use all bp attachments created before site transfer. When trying to read/download file it says “File not found”.
    I checked with my host support help all files/folders permissions – nothing to change there, its have almost full access as it should be.
    Hosting support gave me advice to reinstall site with Duplicator plugin – not helped. They have no other ideas. I hope you can help me. Didn’t found any alternative to your plugin.
    p.s.: sorry for my bad english)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Cavins

    (@dcavins)

    Hi, are you attempting to access files attached to a public or private doc? Files attached to private docs (those that have restricted access so that “everyone” cannot see them) use a file protection scheme. Files attached to public docs are accessible via their public URL.

    With Apache, files attached to private docs are protected via .htaccess rules and served using php once the user’s access has been checked. In practice, this looks like this:

    First request: https://{site-name}/wp-content/uploads/bp-attachments/{doc_id}/{attachment_filename} (302)
    The request is forwarded by the .htaccess rule to this url:
    https://{site-name}/docs/{doc_title}/?bp-attachment={attachment_filename} (200)

    Where the user’s access is checked and the file is served (via php). You can check the network requests using a browser’s inspector.

    Let us know what you find. ??

    Thread Starter boshka

    (@boshka)

    Hi
    all attached files, groups private or public, become unavailable. I checked those files folders in /public_html/wp-content/uploads/bp-attachments/

    some of them have .htaccess file, and some of them dont have it, anyway same result – “file not found”
    .htaccess files have almost same code:
    # BEGIN BuddyPress Docs
    # The directives (lines) between “BEGIN BuddyPress Docs” and “END BuddyPress Docs” are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    RewriteEngine On
    RewriteBase /docs/%d0%bf%d0%be%d0%bb%d0%be%d0%b6%d0%b5%d0%bd%d0%b8%d0%b5-%d0%be-%d0%ba%d0%be%d0%be%d0%bf%d0%b5%d1%80%d0%b0%d1%82%d0%b8%d0%b2%d0%bd%d0%be%d0%b9-%d1%82%d0%b0%d0%b9%d0%bd%d0%b5/
    RewriteRule (.+) ?bp-attachment=$1 [R=302,NC]
    # END BuddyPress Docs
    or
    # BEGIN BuddyPress Docs
    # The directives (lines) between “BEGIN BuddyPress Docs” and “END BuddyPress Docs” are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    RewriteEngine On
    RewriteBase /docs/
    RewriteRule (.+) ?bp-attachment=$1 [R=302,NC]
    # END BuddyPress Docs`

    Plugin Author David Cavins

    (@dcavins)

    Hi @boshka, your second htaccess looks fine. The first doesn’t, but it sounds like it isn’t the problem if you’re seeing the same problem in both cases. What does the rewrite pathway look like? Like what I shared above:

    https://{site-name}/wp-content/uploads/bp-attachments/{doc_id}/{attachment_filename} (302)
    https://{site-name}/docs/{doc_title}/?bp-attachment={attachment_filename} (200)

    You can see the requests by inspecting the web page, choosing the “Network” tab, then clicking on one of your protected attachments. Here’s info about Firefox’s inpector: https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Open_the_Inspector

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“File not found” after site moving to vds server’ is closed to new replies.