Silverstripe Version:
4.1.1
Question:
Hi, i have an problem with rewriting my URL´s in IIS 10 on windows server 2016.
My steps i did:
redirect from www.website.de to www.website.de/public, so i get the silverstripe showed
then with the help of google i found some rewrite snippets that i used to get it rewriting the urls,
but then i tried loging in into the cms and just got plain text and an unsupported browser hint…
i then altered my rules more and more, up to the state were i always get only plain text…
is there maybe sb who could kindly have a look onto my rules?
Thanks in advance, daniel
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="false" />
<rewrite>
<outboundRules>
<rule name="Whatever" preCondition="HTMLCode" stopProcessing="true">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^(.*)/public/(.*)$" />
<action type="Rewrite" value="{R:1}/{R:2}" />
</rule>
<preConditions>
<preCondition name="HTMLCode">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<clear />
<rule name="Incoming" stopProcessing="true">
<match url="^(.*)/(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="public/{R:2}" />
</rule>
<rule name="Incoming2" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="public/{R:1}" />
</rule>
</rules>
</rewrite>
<httpRedirect enabled="true" destination="public" exactDestination="true" childOnly="true" />
</system.webServer>
</configuration>