Protector one
Protector one

Reputation: 7261

Hidden redirect on IIS site?

We have an ASP.NET webforms web application running on IIS 6. There is a permanent redirect in place, for one of its pages: https://www.deurengigant.nl/content/voorwaarden.htm to https://www.deurengigant.nl/content/voorwaarden.

This redirect isn't happening on our local testing version, nor is it happening on a live test version, using the exact same code (including web.config, which has the database connection string): http://test.deurengigant.nl/content/voorwaarden.htm. (Yes, we don't have https on the test version.)

I've already checked the URL rewrite section in IIS Manager for the web site, but there is nothing there. (Pretty sure it simply shows what's defined in web.config rewrite rules anyway.) The HTTP Redirect section shows nothing either.

I've gone through the code looking for redirects, but couldn't find the problem there; also, the test version and our local version use the same code folder.

I've also checked the URL in a Chrome incognito session, to make sure the permanent redirect isn't pulled from cache.

What could I have overlooked? Where else could the 301 Permanent Redirect be set up?

Upvotes: 1

Views: 883

Answers (1)

Protector one
Protector one

Reputation: 7261

The redirect is in applicationHost.config, which is located in C:\Windows\System32\inetsrv\config.

I think it's unwise to put it there, since that file is usually not in source control, nor copied to developer machines for local debugging.

As for why the test version on the live server doesn't have the redirect… I still don't know! They both use applicationHost.config, so they should have them both! That said, check the "error pages" section of IIS Manager. For me, it gives an error for the test version, stating: "cannot add duplicate collection entry of type 'error'". This refers to the error nodes in the httpErrors section of web.config and applicationHost.config, so I think it might be related to that. Maybe a nice conundrum for a rainy day.

Upvotes: 0

Related Questions