I have run multiple PHP (Laravel) applications on my IIS 8 (Win 2012) Server. This is the web.config
file for all of my apps:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>
<rule name="Imported Rule 2" 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" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
But on one appliation, IIS make from time to time a problem: My app don't work, because the URLs are wrong. If i restart the Webserver OR change the web.config
file (add a empty space or something...), it works again.
I have no idea...my other apps works without problems, and it's the same web.config
code.
All Users (IIS_IUSR, Admins, etc) have full write and read access.
My apps are structured in folders, see here:
And i call it with 10.0.0.7/doku
or 10.0.0.7/lagerverwaltung
.
When using IIS I would consider converting each of the specific site folders (doku, lagerverwaltung, etc.) into their own application. That way there will be no confusion over which web.config file is being used when loading and further the apps could then run inside their own app pool and threads.
To do this, inside IIS right click on the specific folder you wish to convert and click on "Convert to Application" in the context menu which opens up. In the subsequent screen you can choose an existing or new Application Pool and also setup any required pass-through authentication you may need.
Forcing the sub-sites to run inside their own application pool and use their own web.config file specifically should eliminate your issue with potential fallback to a base web.config.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With