Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a possible solution with IIS Rewrite module. It may not be the best approach, but it may work. Is there an easier/better option within the MVC routing? Not sure. Only just started doing that myself.</p> <p>Using "<a href="http://server.com/app/enterprise/community/controller/action/" rel="nofollow noreferrer">http://server.com/app/enterprise/community/controller/action/</a>" as an example.</p> <p>What happens:</p> <ol> <li>Strips the string out of the URL. New URL: <a href="http://server.com/controller/action/" rel="nofollow noreferrer">http://server.com/controller/action/</a></li> <li>Redirects the user to new URL. User's browser now shows: <a href="http://server.com/controller/action/" rel="nofollow noreferrer">http://server.com/controller/action/</a></li> <li>Takes the new URL and tries to rebuild it to grab the correct content. User's browser shows: <a href="http://server.com/controller/action/" rel="nofollow noreferrer">http://server.com/controller/action/</a> ; IIS returns: <a href="http://server.com/app/enterprise/community/controller/action/" rel="nofollow noreferrer">http://server.com/app/enterprise/community/controller/action/</a></li> </ol> <p>All of this would be in the web.config once the IIS rewrite module is installed:</p> <pre><code>&lt;rewrite&gt; &lt;rules&gt; &lt;clear /&gt; &lt;rule name="Redirect to remove Offending String" enabled="true" patternSyntax="Wildcard" stopProcessing="true"&gt; &lt;match url="server.com/app/enterprise/community*" /&gt; &lt;action type="Redirect" url="/{R:1}" /&gt; &lt;conditions logicalGrouping="MatchAll"&gt; &lt;add input="{SERVER_NAME}" pattern="*server.com*" /&gt; &lt;/conditions&gt; &lt;/rule&gt; &lt;rule name="Rewrite to get Original Content" enabled="true" patternSyntax="Wildcard" stopProcessing="false"&gt; &lt;match url="*" /&gt; &lt;conditions logicalGrouping="MatchAll"&gt; &lt;add input="{SERVER_NAME}" pattern="*server.com*" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="app/enterprise/community{R:1}" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; </code></pre> <p>Note: Just did this quick, haven't tested.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload