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


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"?>
        <rule name="CakePHP" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
          <action type="Rewrite" url="index.php" appendQueryString="true" />

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:

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


This URL more or less resolved it:

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!

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