The Slim Framework support forum has moved to This Tender forum is no longer maintained or monitored.

IIS rewrite rule

Sjef's Avatar


24 Sep, 2014 12:37 PM

Being new to Slim i used the rewrite rules as suggested by Colling Williamson. In general they work very well for me, but if I add a query string to the url things get nasty

my get request is via '/assignments/:id'
url: assignments/37?uid=4

And than the query part ends up in the route ('37?uid=4')

Any suggetions on how to solve?

  1. 1 Posted by Sjef on 24 Sep, 2014 12:57 PM

    Sjef's Avatar

    This is the rewrite rule I'm using:

    <rewrite> <rules> <rule name="Cols Rule" 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?q={R:1}" appendQueryString="true" /> </rule> </rules> </rewrite>

  2. 2 Posted by Sjef on 24 Sep, 2014 05:54 PM

    Sjef's Avatar

    Fixed this issue using the rewrite rules on

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

  3. Josh Lockhart closed this discussion on 12 Feb, 2021 07:44 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac