Windows 2008 IIS URL Rewrite not rewriting to index.php, Getting 404 Error instead

0

It is not an issue with web.config, I know this because I reinstalled IIS to fix an issue. But for completeness, here is my web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <rewrite>
      <rules>
        <rule name="CakePHP" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>
</system.webServer>
</configuration>

The error in IIS:

HTTP Error 404.0 - Not Found
   The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Module  IIS Web Core
Notification    MapRequestHandler
Handler StaticFile
Error Code  0x80070002

The default action of my index.php is to redirect to login if they are not already logged in---and it's doing that, but:

So as far as I can tell, its actually redirecting to the actual directory /users/login, instead of rewriting to index.php.

I have removed/reinstalled in hopes that might fix it, it doesn't. Whats weird is part of the rewrite is working, the 'IsFile' works, because I have a 'test.php' file in the same directory as index.php, and am able to load that.

as an update, I was going to do Failed Request Tracking:

http://www.iis.net/learn/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules

But where I got to add the rule for 'Rewrite', rewrite does not exist. (but URL Rewrite is in the IIS Panel).

ISSUE RESOLVED:

This URL more or less resolved it:

http://forums.iis.net/t/1178209.aspx?URL+Rewrite+Module+Not+working+at+all

When going to the Failed Request Tracking, I also did not have 'Rewrite' as an option to select.

'Repair' in program and settings did not work for me, so I uninstalled, and then reinstalled, and I'm going!

windows-server-2008
iis-7
rewrite
asked on Server Fault Jun 23, 2014 by brizz • edited Jun 23, 2014 by brizz

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0