0

Some Detail

I tested this with various themes but I'll give you the one for this example but basically when I go to set the background image or a custom JPG image to an area of the theme, apply and save the changes, I see it in the admin but I do not see it from the page outside of the server.

So for a theme called Blackwell, in the Top Page Feature Area I set the Home Top Feature Heading I pointed that to a JPG file, and saved it. I see the image on the server or the preview, but when I go to the site from a different internal machine with both IE and Chrome, the page loads but the image is not visible.

Issue

I get the below icon and when I go to the URL rather than the images I uploaded, etc.

enter image description here

I get this message when I try to go to the link of the icon that is in place of the picture.

enter image description here

What I've tried

I've tried various themes and various JPG pictures of various sizes with the same result. I've also tried adding images to more areas on the theme'd sites than just the Home Top Feature Heading as I mentioned in my example. I'm new to WordPress specifically and I just installed it with most the default and I didn't change anything.

Before I start messing with IIS content types, checking app identity permissions to the image file locations, etc. I figured I'd ask. I checked around the Internet on this topic and most I find is regarding setting up images from scratch and not from a theme but I'm using a theme so I figured I'd ask since again I'm new to WordPress.

Tried this too

On the local WP server rather than going to http://localhost/wordpress/wp-admin/ I changed that over to http://<IPAddress>/wordpress/wp-admin/, removed the theme image, add it back, went out and back in and confirmed the images do not show still from off the local server. I can see text, links, etc. but just not the images. I did all this after making the change and running an iisreset on the server with Windows Firewall disabled. It seems now the blank or dissociated icon points back to the home page of http://10.1.10.120/wordpress/ so that is where the browser goes when it is clicked rather than the localhost.

What configuration files or other details should I include that'd be helpful?

Specs

  • Windows Server 2012 R2 VM x64
  • WordPress 4.7.1
  • MYSQL Server 5.1
  • IIS 8.5
  • I installed WP on the Server 2012 R2 OS using most all the default settings using MYSQL Server and installing typical component per the MS Web Platform Installer. I documented everything along the way that needed documented.
  • Program and Features enter image description here
  • Sorry if I left out important detail or overlooked something simple here. Just seeing if anyone has any suggestions before I start digging into it with more detail since I'm new to WP. I'll be glad to add more detail if needed as well. – Facebook Feb 14 '17 at 22:24
  • 1
    Can you explain your setup again? You have a local Windows Server that hosts the website, and you have issues viewing the site from other local computers? – ngearing Feb 14 '17 at 23:00
  • @Nath I added more detail, please let me know if you see anything obvious or even simple I'm overlooking or if I need to disclose something more specific that'd help clarify. – Facebook Feb 15 '17 at 5:59
  • @Walmart Hi, if you could add one of your image's link (Both broken one in theme, and working one in admin) it would be easier to detect the problem. Something is changing the links on the theme. – Jack Johansson Feb 15 '17 at 6:31
  • If you upload an image to the root of that website, where you wp-config file sits can you access that image from the browser of another local computer? – ngearing Feb 15 '17 at 22:17
1

It seems to me that the URL is wrong for the images (HREF). Most like you are modifing or adding content to the site directly from the server while accessing it from http://localhost/.

Based on your screenshot, the error message you're getting on the workstation refers to "localhost/wordpress/content/uploads...." where localhost is the server, BUT in reality, localhost refers to the current workstation/device/server name!

A basic fix/solution would be to:

  1. Go to the server
  2. Open the WP site admin panel using the server's name. E.g. http:\\server\wp-login.php.
  3. Remove and re-add the image to the post.
  4. Test the page from the workstation (which I believe you are accessing by the servers name http:\\server\)

Other solutions include:

  1. Modify the way the images are injected to the WYSIWYG and prevent the domain name to be added
  2. If I'm not mistaking, there is a way to force relative paths by modifying the wp-config.php file, but cannot recall the method right now.

Let me know if I misunderstood something.

EDIT / SOLUTION

The solution was related to WordPress configuration. Themes. plugins and others will relay on the settings set for WP_HOME and WP_SITEURL to "grab" static files. Please change your configuration settings to use your "public" facing domain name, server name or server IP address, instead of using localhost.

The above settings can be set from 2 different locations, WP Admin page or wp-config.php. However, you either use one or the other.

Typical WP users will go to WP Admin > Settings > General and change the settings for WordPress Address (URL) and Site Address (URL).

Please keep in mind that wp-config.php does not include these variables in their sample file because is meant to be used only by advanced users and rare cases.

Example

Your domain name is test123.com (because I'm super creative)

WP Admin page WP Address and WP Site Address

WP-CONFIG.PHP

define('WP_HOME', 'http://test123.com/wordpress');
define('WP_SITEURL', 'http://test123.com');
  • Your almost there. Crack open Google Chrome and inspect your paths through Developer tools at runtime to investigate the paths to your images. That will give you clues on what to do next! – klewis Feb 15 '17 at 12:10
  • Walmart (?) were you able to solve the issue? I believe you are over thinking this issue. Your issue is not IIS or the server, but WordPress configuration. As someone mentioned in another comment, could you give an example of an image HREF when it does not work and one when it works (admin)? I believe you configured your site to use absolute paths and your wp-config.php file has a domain name similar to localhost. Check and let us know. – Jorge Raigoza Feb 18 '17 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.