Microsoft's Internet Information Services (IIS) offers a custom 404 page and many users assume that a custom 404 returns 404:Not Found header responses. Not so. Just like the Joomla! 404's, IIS returns a 200 OK HTTP header response. This means that incorrect URL's and bad links back to your site can potentially end up in search engine listings. Headers must always properly represent the content that is being delivered by that page. If the URL is not found then it is not found and headers should not say, "ok, it's here" as they do when a 200 status code is returned.
So, what to do about it? Unfortunately, there is not a "one size fits all" with IIS because the handling of custom 404 error pages is slightly different between the different versions of IIS. Before I start, I will give a warning - I do not routinely use IIS. The last time I did was years ago and I have only used IIS 6 recently for testing the creation of 404 error pages that give the correct status response. If anyone finds any errors in this tutorial please feel free to correct me!
First thing to do is to make sure your server checks for non-existent PHP files. If you don't have access to the IIS configuration you may need to open a support ticket with your host and get the host to enable this setting, if they have not already done so (most will have). Access your Extensions Mapping. Go to Website Properties -> Home Directory and access Configuration. Select PHP and click on "Edit". Down the bottom, look for the checkbox next to "Check that file exists" - if it is not checked, then check it and save by clicking, "ok".
With this enabled any time an incorrect URL is called PHP will check if the file exists. If it does not exist on your server the correct 404 status headings will be sent.
Then either create a static page to use as your custom 404, or create a page within Mambo to use with your Mambo CMS site. This tutorial explains how to create a custom 404 page in Mambo.
Now, to set up IIS 6 so it uses the custom 404 error page you go to IIS Administration and select your Web. Right click then select the "Custom Errors" tab. Scroll down until you find the 404 listed in the HTTP Error column. Select this by clicking on "Edit".
Microsoft suggests that an absolute URL needs to be entered here (you do NOT want to choose the "file" option unless you have created a static 404 error page), however if you do input an absolute URL IIS will then return a 200 OK header response. I found that inputting a relative URL in the same way I do for Apache not only worked but it produced the correct headers. Try it. Your URL should be the non-SEF URL to the page you created in Mambo and will look something like this:
/index.php?option=com_content&task=view&id=179&Itemid=30
If this does not work for you then create a new PHP file as discussed in the previous tutorial and use that URL, eg. /error.php. Search engines can handle a 301 redirect that ends in a 404 Not Found and they do not index either page.







