Menu

Another media glitch

Help
Thomas52
2012-05-06
2013-05-30
  • Thomas52

    Thomas52 - 2012-05-06

    I backed up my media files, and then started getting errors on my media:

    Forbidden - You don't have permission to access /media/horseshoe_bend_war_1813-14.jpg on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/1.3.42 Server at www.adkins9.net Port 80

    As an example - root is www.adkins9.net, and image http://www.adkins9.net/media/horseshoe_bend_war_1813-14.jpg
    I double-checked, the file IS there.  I double-checked my permissions: media, media/thumbs, index, index/media, index/media/thumbs were wrong(?,) but now are all 777. Enable multimedia - yes, and as a precaution changed media firewall - no.
    Still no joy.  I did something wrong, but can't figure it out.  Help, please.

     
  • Gerry Kroll

    Gerry Kroll - 2012-05-06

    This is a permissions problem on the actual file, not on the directory.  It looks as if you might have uploaded the file to the media directory using a tool like FTP instead of using the media upload facility built into PGV.

    The individual files need 755 permission.  On some servers, you can get away with 644.  Mine insists on 755.  755 is never wrong.

    You're getting the "404 not found" error because the .htaccess file in the ./media directory is not constructed properly.  To fix this, you need to enable the media firewall, and then use the Manage Media page to move all media files to the protected media directory.  This will re-build the .htaccess file.  It might be wise to move everything from the protected media directory to the unprotected one, and then move everything back again.

    If you want to stop using the media firewall, you need to use the Manage Media page to move everything to the regular media directory before disabling the media firewall.

     
  • Thomas52

    Thomas52 - 2012-05-06

    Gerry: Although I couldn't define it, I was almost certain what had gone wrong, and who would nail it on the head.
    That's exactly what I did wrong, however the solution does not quite seem to work.  If it's okay, I will email you separately.

     
  • Thomas52

    Thomas52 - 2012-05-06

    Yikes!  Finally found it, and as Gerry predicted - I copied another .htaccess file from a pending webtress installation to read:
    ######## BEGIN WT MEDIA FIREWALL SECTION ##########
    ################## DO NOT MODIFY ###################
    ## THERE MUST BE EXACTLY 11 LINES IN THIS SECTION ##
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* /mediafirewall.php
    </IfModule>
    ErrorDocument 404 /webtrees/mediafirewall.php
    ########## END WT MEDIA FIREWALL SECTION ##########

     
  • Gerry Kroll

    Gerry Kroll - 2012-05-06

    I should have suggested that you delete the existing .htaccess file before doing that media firewall and moving of media files thing.

    I know that the media firewall will create a .htaccess file if it's missing.  It's been a looooong time since I last looked at that code.

     

Log in to post a comment.