• I’m using the latest WordPress version (3.4.2) on IIS 7.0 (Windows 2008R2).

    Everything works lovely apart of the redirects rules on web.config.

    When setting permalinks, I get the <rule> that should be added to the configuration file, but using that, I can only have permalinks to pages. All normal images (I can see all generated thumbnails from the uploaded images) I can’t have access to: 500 Error. As well the other way around, I will get a 404 Error but I will see all original images.

    I have written 2 rules, each one serves it’s propose well, but I can’t figure it out how to have both running.

    <rewrite>
      <rules>
        <rule name="wordpress-images" patternSyntax="Wildcard" stopProcessing="true">
          <match url="https://mitivo.gavekortet.dk/wp-content/uploads/*.*" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php/{R:0}" />
        </rule>
    
        <rule name="wordpress-links" patternSyntax="Wildcard" stopProcessing="true">
          <match url="*" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php/" />
          </rule>
        </rules>
    </rewrite>

    If I delete wordpress-images rule, I can normally access any page like www.domain.com/my-page-name

    If I delete wordpress-links rule, I can see and point any image to the original uploaded file, and it even shows in the Media Editor.

    But I need them both running… any idea what it’s going on?

    site is been hosted on https://mitivo.gavekortet.dk

  • The topic ‘WordPress under IIS, I can either have permalinks or images’ is closed to new replies.