Graphics and Formatting Not Loading in WordPress on IIS

We have IIS 7.5 and we've installed WordPress (v3.3.1) through the Microsoft Web Platform installer (http://www.microsoft.com/web/wordpress).

All works fine when we load WP locally (e.g. http://localhost/mywordpresssite), the graphics load fine. But when I enter the IP address or hostname accessing the site from a machine other than locally, none of the graphics or formatting appear.

Is there some configuration I have to set to get this working?

I've noticed that all the graphics etc. are hard-wired to 'localhost', which explains why I'm losing the images when accessing from a remote machine. e.g.

http://localhost/mywordpresssite/wp-content/themes/twentyeleven/images/headers/lanterns.jpg

Help!!

Topic iis formatting configuration installation images Wordpress

Category Web


This may not be the right solution, but I had the symptoms (styles and images not loading) in a different case: Take a look at the XML generated by Wordpress for web.config. At least in some cases, it is incorrect. I've worked it through in the multisite case (different from this case) and had to change Rule 4 action to point to url="{R:2}" and Rule 5 to point to url="{R:3}".

<rule name="WordPress Rule 4" stopProcessing="true">
   <match url="^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
    <action type="Rewrite" url="{R:2}" />
</rule>
<rule name="WordPress Rule 5" stopProcessing="true">
    <match url="^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
     <action type="Rewrite" url="{R:3}" />
</rule>

Check that your WordPress Address and Site Address are correct under Settings > General. ie., if you want it to be viewable on another computer, this shouldn't say "localhost" anywhere...

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.