Support » Fixing WordPress » [Broken Links] Media Gallery

  • Resolved leandro980

    (@leandro980)


    Hi,
    i’ve a “common” problem as i could see searching the forum but no solution worked for me.

    I have some image with broken link with no apparent reason, mainly featured images imported using nextgen gallery, but not only those.

    Broken Image NGG

    Broken Link Media Image

    Other images are still working. I’ve checked by the FTP and the image are in the right folder, i’ve tryied also to download them to verify if they’re broken but it’s all right.

    I’ve tryied to change permission to upload folder to 775 and 777 (now turned to 755) but no results.

    This is the .htacces inside the upload folder

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteRule (.*) /index.php?uamfiletype=attachment&uamgetfile=$1 [L]
    </IfModule>

    and this one inside the root

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /sally/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /sally/index.php [L]
    </IfModule>
    
    # END WordPress

    Any idea?
    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Is the .htaccess file inserted by a security plugin?
    Try downloading the .htaccess file to a safe place on your computer, then delete it from the uploads directory.
    Try the images.

    If the problem persists, then upload the .htaccess file again to its former place.

    I have a security plugin that added a htaccess file to uploads and it did what you are experiencing, so I removed it – which the plugin warned me of beforehand that it might hamper uploading.

    Thread Starter leandro980

    (@leandro980)

    Ok thank you!
    I’ve deleted the .htaccess inside the upload directory and it worked!
    Is it necessary? Is it secure deleting it?
    I have no idea of which plugin addedd the .htaccess in that folder. I have no specific plugin that manage the .htaccess, but i’m usign NextGen Gallery for images.

    Do you have a security plugin such as Sucuri or WordFence?
    These would inject .htaccess to protect your site and some plugins use the term “hardening”.
    The plugin I use says this:

    Protect uploads directory

    It checks if the uploads directory of this site allows the direct execution of PHP files. It is recommendable to prevent this because someone may try to exploit a vulnerability of a plugin, theme, and/or other PHP-based code located in this directory sending requests directory to these files.

    Note: Many plugins and themes in the WordPress marketplace put (insecure) PHP files in this folder for “X” or “Y” reasons, they may not want to change their code to prevent security issues, so you will have to keep this option un-hardened or else you will end up breaking their functionality.

    I have had my uploads directory “unhardened” for quite awhile without problems.

    You may mark this thread “Resolved” if that is all.

    Thread Starter leandro980

    (@leandro980)

    Nope, no Sucuri nor WordFence.
    The fact is that i didn’t install no new plugin since months. And it all worked in past.

    I have other sites in WP using NextGen and no one has the .htaccess file inside the upload dir.

    The only change i’ve done is that i had changed the permalink structure form WP admin panel but even undoing the change it didn’t solve. And anyway some image worked and some other no :\

    Thread Starter leandro980

    (@leandro980)

    Ok, deleting the .htaccess inside the Upload Directory it solved.
    Thank You for your support!
    Leandro

    My advice is to definitely install a security plugin. Better than getting hacked.

    Thread Starter leandro980

    (@leandro980)

    Done! (Sucuri) Thanks again 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Broken Links] Media Gallery’ is closed to new replies.