Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Rewrite rules interfere with Shibboleth
  • Windows Server 2012, IIS 7, PHP 5.3, FuelPHP, running a site that uses Shibboleth for authentication. Static pages work as expected, but, pages running under the Fuel framework, with URLs rewritten to index.php fail with 'page not found'. The full query string is passed to Fuel, and since Fuel has no matching controller, the 'page' is not found.

    The authentication server sends back a return value of <mysite>/Shibboleth.sso<lots of stuff>. The Shibboleth.sso command is sent through to FuelPHP and fails. When I remove the rewrite rules, Shibboleth properly parses the query string and sends me to the correct target.

    Here is the webconfig that causes the failure:

        <?xml version="1.0" encoding="UTF-8"?>
          <configuration>
            <system.webServer>
              <rewrite>
                <rules>
                  <rule name="Index" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                      <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/{R:1}" />
                  </rule>
              </rules>
            </rewrite>
                <defaultDocument>
                    <files>
                        <add value="index.php" />
                    </files>
                </defaultDocument>
          </system.webServer>
        </configuration>

    Any idea how to get Shibboleth to play nice with IIS URL rewriting?

  • Assuming shibboleth.sso is an existing file in the public folder, this should work. The conditions should block the rewrite from happening if an existing file or directory is requested.

    You don't have an issue with other files in your public folder, for example images?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion