Note that there are some explanatory texts on larger screens.

plurals
  1. POApp_Offline.htm redirect using UrlRewriting
    primarykey
    data
    text
    <p>We host a multi-tenant web site which is branded to suit the client based on the domain name. The web site is developed using Asp.net MVC4.</p> <p>We plan to use the app_offline.htm file to take the web site offline during maintenance periods. However, we want the maintenance page to be branded based on the domain. In order to achieve this, we decided to use the UrlRewrite module. </p> <p>The logic for the rewrite rule is that if the request is from a specific domain and the app_offline.htm file exists in the web site, then redirect to that domain specific (branded) app_offline page. The rules in our web.config are as below:</p> <pre><code> &lt;!-- App_Offline redirects --&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;rule name="Domain1 App_offline redirects" stopProcessing="true"&gt; &lt;match url="^(.)*" /&gt; &lt;conditions logicalGrouping="MatchAll"&gt; &lt;add input="{HTTP_HOST}" pattern="^domain1" /&gt; &lt;add input="{DOCUMENT_ROOT}/app_offline.htm" matchType="IsFile" /&gt; &lt;add input="{REQUEST_URI}" pattern="domain1.app_offline.htm" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Redirect" url="https://{SERVER_NAME}/domain1.app_offline.htm" /&gt; &lt;/rule&gt; &lt;rule name="Domain2 App_offline redirects" stopProcessing="true"&gt; &lt;match url="^(.)*" /&gt; &lt;conditions logicalGrouping="MatchAll"&gt; &lt;add input="{HTTP_HOST}" pattern="^domain2" /&gt; &lt;add input="{DOCUMENT_ROOT}/app_offline.htm" matchType="IsFile" /&gt; &lt;add input="{REQUEST_URI}" pattern="domain2.app_offline.htm" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Redirect" url="https://{SERVER_NAME}/domain2.app_offline.htm" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; </code></pre> <p>The problem we now face is that though this Url rewrite rule kicks in and redirects the user to the branded offline page, it initially displays the content of the non-branded app_offline.htm page. After a couple of seconds, on refreshing the page, the actual branded content is displayed.</p> <p>We also noticed that when the generic app_offline.htm content is displayed, the HTTP response is a 503, whereas when the branded app_offline.htm is displayed later, the HTTP status is 200.</p> <p>Is there any way that we can overcome the initial display of the generic app_offline.htm content?</p> <p>Do you see any performance issues with the above Url rewrite approach?</p> <p>Thanks in advance.</p> <p>EDIT: I have realised that the refreshing the domain specific app_offline page causes it to be cached in the browser and thats where the content is displayed from. Without refreshing the branded app_offline page, trying to access any other page on the site always displays the generic app_offline.htm content :) So, looking at alternatives....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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