0
votes

For some reason, all of my wordpress images stopped displaying. I've tried disabling all plugins, and reverting to twenty-twelve theme, but still nothing.

When I login to the dashboard and go to the Media Library, this is what I see:

Media Library

But when I click on one of the images, and go to its path, the image URL will load the image.

It almost seems as if Wordpress has disconnected itself from my uploads folder?

Lastly, on my homepage, when I right-click on the broken image link for my logo (that's not displaying), and choose "Open image in new tab", it doesn't actually return the image URL. It returns:

http://127.0.0.1/

Has anyone else come across this before? I have no idea where to begin solving this, as it doesn't seem to be associated with my theme, or my plugins, and my Wordpress core is up to date.

Any help would be much appreciated. Thanks!

2
Did you recently move the site, let's say from your local machine, to a server?coopersita
No the site hasn't moved at all. It's been in this location for several months now, without any issues. I actually looked into my FTP client though and found that several sites had been updated at 1:45am (likely non-human). In each instance, there was a line of code added to the .htaccess file: "RewriteRule .*\.(gif|jpe?g?|png)$ 127.0.0.1 [R,NC]" - Does anyone know if this is part of the All in One WP Security (AIOWS) plugin?Eric Wood
Looks like you may have been hacked... Open you theme files, and see if there is anything suspicious there.coopersita

2 Answers

1
votes

The change the the htaccess file that you mentioned in a comment is likely the cause. This is not part of WP Security plugin. Since you have that security plugin installed, you hopefully made a restore point of your htaccess file and should be able to get a good copy back quickly - it's one of the plugin's features.

Details here: https://www.tipsandtricks-hq.com/how-to-restore-the-htaccess-file-when-using-the-all-in-one-wp-security-plugin-5945

If you need to redo the file via FTP instead, here's a list of the most likely htaccess file content, derpending your site's exact needs: http://codex.wordpress.org/htaccess

Probably, it should look like ths:

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

It can be a hack, but this generally happens when your wp_options are not correctly configured.

Quick way to solve: Restore a backup to a previous working condition.

If you don't have a backup or want to check other options, try this:

  1. open phpmyadmin in your live server and access the Wordpress database;
  2. Inside the Database, access the table wp_options;
  3. Check the values for the rows 'siteurl' and 'home'.

EDIT: Method 2 - re-create .htaccess

  1. Rename your .htaccess to htaccess_
  2. Go to Wordpress Settings -> Permalinks
  3. Select the default type and Save, this should create a new .htaccess
  4. Open the homepage of website and check if it changed something
  5. Return to Permalink Options and select the way you had it before