Wordpress 500 (URL Rewrite Module Error.)
Asked Answered
V

5

9

I am hosting a Wordpress website in IIS 8 I am getting the following error:

Failed to load resource: the server responded with a status of 500 (URL Rewrite Module Error.)

When I upload a new image and display. If I go to wp-content and give IIS_USRS access then the image works, when I add a new image I have to remove IIS_USRS and add it again for the image to work

If I use the following web config the website never loads

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
  <rules>
    <rule name="wordpress" patternSyntax="Wildcard">
      <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>

Vamp answered 2/9, 2015 at 9:31 Comment(2)
IIS URL Rewrite module is a separate download, so have you installed it?Generate
Yes it is Installed, I am using it also to redirect non ssl to ssl on other websitesVamp
M
16

Use these below mentioned RULEs in your web.config file:

<rules>

    <rule name="Imported Rule 1" stopProcessing="true">
        <match url="^index\.php$" ignoreCase="false"/>
        <action type="None"/>
    </rule>

    <rule name="Redirect Image to HTTP" stopProcessing="true">
        <match url=".*\.(gif|jpg|jpeg|png|css|js)$" ignoreCase="true"/>
        <action type="Rewrite" url="{R:0}"/>
    </rule>

    <rule name="Imported Rule 2" stopProcessing="true">
        <match url="." ignoreCase="false"/>
        <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
        </conditions>
        <action type="Rewrite" url="/index.php"/>
    </rule>

</rules>
Mohammedmohammedan answered 11/7, 2017 at 13:36 Comment(0)
N
6

I changed the permissions in the security tab to the wp-content folder of wordpress within the iis manager, it was necessary to edit and then I gave full control to IIS_USRS and the error was solved

Neilson answered 5/6, 2019 at 22:28 Comment(0)
T
3

In case anyone still has this problem, the last step that fixed it for me was to set the identity of the app pool to 'local system' (right click the app pool in the list -> advanced settings -> under the 'process model' section)

Also follow Alejandro's advice and make sure the sufficient folder privileges are set.

Turbinate answered 27/3, 2021 at 11:1 Comment(1)
it is temp solution .thank youGratulant
B
0

For me, changing the identity of the app pool worked(thx lockstock). As a workaround, I tested it by cropping the images and saving them, there was no need to edit the permissions. I use win server2019 with the latest updates (IIS 10 and PHP 7.4).

NOTE: If you are creating a new wp site, by default use http://localhost/?P=123 as permalinks, but if you want to change this to %postname%, wp creates a new roule under URL rewrite on IIS, this is the reason for displaying the error for any file, post. I hope it's helpful.

URL REWRITE RULE

Bea answered 16/4, 2021 at 19:50 Comment(0)
K
-1

Server doesn’t have proper permissions for temporary folder C:\Windows\Temp” directory

  1. Edit the php.ini file and change the location of the “upload_tmp_dir” variable from the Windows TEMP directory to another location

  2. Restart server

Kastroprauxel answered 7/7, 2023 at 20:18 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewScyphozoan

© 2022 - 2025 — McMap. All rights reserved.