Custom 404 error page for stopped websites on IIS - iis-7.5

When you stop a website on IIS and you try to surf to the binded URL, you get a general 404 error page. As one would expect.
But is there a way to edit this page/or set a custom page?

As far as I know, if you stop the site, that means the IIS will not listen the IIS site's port.
So the request will not send to the IIS, IIS will not return any response to the client. The server refused the connection.
In my opinion, there is no way to set the a custom page by IIS.

Related

Application Request Routing: Why some sites return HTTP 404 some don't?

I want to add a load balancer to an existing asp.net project using Application Request Routing. So I made myself familiar with the concepts and created a local test-setup:
IIS locally running on Windows 10:
Installed Application Request Routing 3.0 with Windows Platform Installer
Created server farm with following servers:
<test-server-name>.de (Microsoft 2012 R2 Server: contains the asp.net project)
www.google.com (just to see if load balancing and url rewriting works because I don't have two test servers available)
URL-Rewriting rule:
After typing localhost multiple times in any browser, I can see that load balancing (weighted round robin) is working fine. It's alternating between 1. and 2. website.
The problem I'm facing is a 404 Error on both websites.
I already tried the following:
Installing and enabling Failed Request Tracing Rules (on local IIS): URL Rewriting is working properly i think.
Failed Request Log for www.google.com: google drive, unzip and open xml in e.g. IE for better view
Create Server Farm without automatic creation of URL Rewrite rules
(selecting No and create own URL Rewrite rule)
Change "Managed Pipeline Mode"-setting of Applcation Pool from Integrated to Classic
Healthcheck on other Websites I have absolutly no clue why it's working on Git-websites and why facebook is returning a 400 error code.
Enabling/disabling proxy (IIS-Manager -> Application Request Routing Cache -> Server Proxy Settings...)
I don't know what i could do next, so I appreciate any help. Thanks.
Answer can be found here: https://forums.iis.net/t/1238739.aspx?Why+some+sites+return+HTTP+404+some+don+t+
Some websites simply don't support localhost as hostname, which is why localhost can't be found (error 404) e.g. on google.com
Detailed answer if link above is not working in future:
That is not an effective test.
What you are doing is sending the hostname of your request to the third party servers. Like Google.
So if your request is say http://example.com you are sending this to say www.google.com and the Google servers will likely reject this as you can see
Web server admins generally don't let themselves receive traffic from domain thet do not host.
If you sent a request to my servers IP with mysite.com I too would likely reject it. (Things get complex if you have wildcard sites and you allow all traffic through)
But simply showing that 404 page from Google means tour request hit there server so that implies ARR is working.
If you really wanted to test it this way have a local host file with www.google.com resolving to your servers IP. Set up a site with www.google.com as the hostheader and then you should see the correct info hitting Google. But there is no accounting for what 3rd party admins do on their side.

Using custom error pages with ARR / Application Request Routing

How can I display custom HTML instead of the following 502 response from ARR?
Traffic is directed to the server farm using a URL Rewrite rule on the server level.
Open IIS and then on the server level, in the IIS section, click "Error codes". These files are global, which is the level you will want to change for your situation. There are also site level error pages. You can modify these files or you can point them to a different file that you have customizedIIS Error Pages.

IIS: add binding to Default Web Site

I just started looking at IIS on Windows10.
I have a stupid question. I added a binding to Default Web Site ("www.test.com") in IIS Manager.
I was expecting to see the default page when browsing to this url, but it took me instead to an actual existing page.
Can anyone explain me why?
If you've added www.test.com to your bindings, clients (like your web browser on the same system) still don't know that IIS hosts the site.
see this: Setting up a Host File - Faking URLs
This is useful when dealing with multiple sites:
Site 1:
test.com
www.test.com
www2.test.com
Site 2:
another.url.com
with just listening to a single IP, you cannot control which request ends up at which site, this is what the binding solves

HTTP 404 error while trying to browse web site created on IIS 7.5

I am completely newbie with IIS. I have Win2008 with IIS 7.5 installed. I can start "Default Web Site" via IIS Manager GUI , but I get "HTTP 404 error - webpage cannot be found" while trying to browse it. What webpage is expected ? I have index.htm & default.aspx under c:\inetpub\wwwroot ... Also , I am not sure where to look for the logs. What is the best way to troubleshoot? Thanks for you help!
Are you sure you are accessing you website through out the good port? Check in your IIS configuration for your default web site, maybe it is not set to port 80 (which should be the default).
Also, many other programs like Skype may use this port already and IIS is not able to activate the website because the port is already in use.
You should try to set the IIS default website port to something else than 80.
Give it a try!
Check your default website mode, I guess its process was stopped. Try to restart the process. If you get any "Process is being used" error, try to close the exe's like skype of any third parties which refer the 80 port.

Handling custom errors with a port in the URL for IIS

I am trying to specify a custom (ASPX) page to handle 404 errors.
I can't seem to do this with IIS because I use a port other than the default.
I have two versions of my site, one exposed (default port) and one on another port, for testing. I'm trying to do this in testing mode first.
If I do:
http://www.mysite.com/notapage ... I get the IIS 404 error.
If I do:
http://www.mysite.com:1234/notapage ... I get a Google error (I use Google Chrome) as if it cannot resolve my site even though http://www.mysite.com/ works.
Any ideas?
On which level you configure this ASPX page for 404? If you did that on default web site, it only works for first test link you provided.
port 1234 should be monitored by another web site. Please check your IIS settings and make sure that that site was configured correctly.

Resources