So, I never found a solution to this problem, but I found an alternative to what I was trying to achieve.
Basically, I wanted to show a specific "stand-alone" page for each application, which would be displayed when the site was turned off. Here is what I did ...
I created a website that I called "_offline" in IIS. Then I added a common catch-all binding for the port: 80 and left the host name blank. You may need to disable the current website by default until this commitment is accepted.
Create an index.html page and place the content you want to show and run it as the default page for "_offline". I will add a little script below that works very well.
Now you can test by disabling your site, you will see your new index page. If you cannot disable the website, add the binding in your hosts file to something like "testdomain.com" and point it to your server. After that, your offline page should appear in your browser.
Just in mind, this page will be displayed at any time when your IIS cannot find the active site at the incoming address. Depending on your installation, this may or may not be acceptable, in which case you should not use this method.
Now for my index page. I installed some javascript to determine which site is trying to reach, then the html part will show. I also have a countdown that starts and tries to refresh the page every 10 seconds.
In any case, this is not an ideal result, but it works.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width = device-width"> <title>Under Maintenance</title> </head> <style> body{ color:#014795; } .container{ max-width:650px; margin:auto; font-size:18px; font-family:Arial, Helvetica, sans-serif; padding:20pt; text-align:center } #logo img { max-width:100%; } a { color: inherit; text-decoration: none; } a:hover { color: inherit; text-decoration: none; } </style> <body> <table class="container"> <tr> <td> <span id="logo"></span> <p>This site is currently under maintenance and will be available shortly.</p> <p>We apologize for any inconvenience caused.</p> <table style="text-align:left;margin:auto;"> <tr><td>Telephone:</td><td><a href="tel:+27111111111">+27 11 11 1111</a></td></tr> <tr><td>Fax:</td><td>+27 11 111 2222</td></tr> <tr><td>Email:</td><td><a href="mailto: support@fubar.com "> support@fubar.com </a></td></tr> </table> <p>We will automatically try to reconnect you in <span id="timeleft"></span> seconds</p> </td> </tr> </table> <script type="text/javascript"> var refreshEvery = 10; var currentSec = 0; var timer = setInterval(function() { currentSec++; if (currentSec >= refreshEvery) { clearInterval(timer); location.reload(); } document.getElementById("timeleft").innerHTML = "" + (refreshEvery - currentSec); }, 1000) document.getElementById("timeleft").innerHTML = "" + (refreshEvery - currentSec); </script> </body> </html>
source share