Hello All,

We have configured IIS 6 websites using Host Header to have multiple
domain names mapped to a single website (to optimize the IIS resource
utilization) . However, I want each domain to be pointing to a
different folder, something like:

website1
|-------Root
|-------Domain1
|-------Domain2
|-------Domain3

website2
|-------Root
|-------Domain4
.... and so on

The webiste1 HomeDirectory points to website1\Root, while I need all
Host Header (domain names) to point to their respective Folders. This
'Domain Name to Physical Path' mapping is kept in a text file.

We wrote an ISAPI Filter which is registered for IIS Event
'SF_NOTIFY_URL_MAP', and it fetches the information from the text file
and accordingly changes the PhysicalPath for the incoming HTTP
Requests.

This setup is working for all types of file extensions so far
including ASP.NET 1.1

Recently we have installed .NET Framework 2.0 and configured all
ScriptMaps to use version 2.0 (aspnet_regiis -r), and since then the
redirection explained above does NOT work for ASP.NET pages. Any
domainName which has ASPX page is looked at in HomeDirectory of the
corresponding website, while any other file extension is picked from
the configured mapping.

Can somebody please explain this behavior? Is it because of 'Faulty
Installation/Configuration' of .NET 2.0?

Thanks in advance
~TJ

Re: IIS 6 | URL Mapping with ISAPI Filter | ASP.NET 2.0 by Steve

Steve
Wed Feb 21 21:49:24 CST 2007

I'm not sure what your ISAPI is doing wrong. There is a 3rd party one that
would do exactly what you need. www.isapirewrite.com

--

Steve Schofield
Windows Server MVP - IIS
ASPInsider Member - MCP

http://www.orcsweb.com/
Managed Complex Hosting
#1 in Service and Support

"TJ" <tj_tronics@yahoo.com> wrote in message
news:1172091742.377627.283610@t69g2000cwt.googlegroups.com...
>
> Hello All,
>
> We have configured IIS 6 websites using Host Header to have multiple
> domain names mapped to a single website (to optimize the IIS resource
> utilization) . However, I want each domain to be pointing to a
> different folder, something like:
>
> website1
> |-------Root
> |-------Domain1
> |-------Domain2
> |-------Domain3
>
> website2
> |-------Root
> |-------Domain4
> .... and so on
>
> The webiste1 HomeDirectory points to website1\Root, while I need all
> Host Header (domain names) to point to their respective Folders. This
> 'Domain Name to Physical Path' mapping is kept in a text file.
>
> We wrote an ISAPI Filter which is registered for IIS Event
> 'SF_NOTIFY_URL_MAP', and it fetches the information from the text file
> and accordingly changes the PhysicalPath for the incoming HTTP
> Requests.
>
> This setup is working for all types of file extensions so far
> including ASP.NET 1.1
>
> Recently we have installed .NET Framework 2.0 and configured all
> ScriptMaps to use version 2.0 (aspnet_regiis -r), and since then the
> redirection explained above does NOT work for ASP.NET pages. Any
> domainName which has ASPX page is looked at in HomeDirectory of the
> corresponding website, while any other file extension is picked from
> the configured mapping.
>
> Can somebody please explain this behavior? Is it because of 'Faulty
> Installation/Configuration' of .NET 2.0?
>
> Thanks in advance
> ~TJ
>


Re: IIS 6 | URL Mapping with ISAPI Filter | ASP.NET 2.0 by Wade

Wade
Wed Feb 21 22:05:25 CST 2007

Hi TJ,

The problem is that ASP.NET 2.0 doesn't use the physical filename provided
by IIS. It calculates the physical filename based on configuration data.

The only way that I know of to make this work with ASP.NET 2.0 is to rewrite
the URL instead of the physical file. You would do this by moving from the
SF_NOTIFY_URL_MAP to the SF_NOTIFY_PREPROC_HEADERS notification.

Thank you,
-Wade A. Hilmo,
-Microsoft

"TJ" <tj_tronics@yahoo.com> wrote in message
news:1172091742.377627.283610@t69g2000cwt.googlegroups.com...
>
> Hello All,
>
> We have configured IIS 6 websites using Host Header to have multiple
> domain names mapped to a single website (to optimize the IIS resource
> utilization) . However, I want each domain to be pointing to a
> different folder, something like:
>
> website1
> |-------Root
> |-------Domain1
> |-------Domain2
> |-------Domain3
>
> website2
> |-------Root
> |-------Domain4
> .... and so on
>
> The webiste1 HomeDirectory points to website1\Root, while I need all
> Host Header (domain names) to point to their respective Folders. This
> 'Domain Name to Physical Path' mapping is kept in a text file.
>
> We wrote an ISAPI Filter which is registered for IIS Event
> 'SF_NOTIFY_URL_MAP', and it fetches the information from the text file
> and accordingly changes the PhysicalPath for the incoming HTTP
> Requests.
>
> This setup is working for all types of file extensions so far
> including ASP.NET 1.1
>
> Recently we have installed .NET Framework 2.0 and configured all
> ScriptMaps to use version 2.0 (aspnet_regiis -r), and since then the
> redirection explained above does NOT work for ASP.NET pages. Any
> domainName which has ASPX page is looked at in HomeDirectory of the
> corresponding website, while any other file extension is picked from
> the configured mapping.
>
> Can somebody please explain this behavior? Is it because of 'Faulty
> Installation/Configuration' of .NET 2.0?
>
> Thanks in advance
> ~TJ
>



Re: IIS 6 | URL Mapping with ISAPI Filter | ASP.NET 2.0 by TJ

TJ
Thu Feb 22 06:51:49 CST 2007


Hi Wade,

Thanks for the reply. Few more questions...

> The problem is that ASP.NET 2.0 doesn't use the physical filename provided
> by IIS. It calculates the physical filename based on configuration data.

[TJ]: So isn't this change in behavior over ASP.NET 1.1 and ASP.NET
2.0 Request Processing? If it is, then is there any way this
'behavior' can be toggled?

> The only way that I know of to make this work with ASP.NET 2.0 is to rewrite
> the URL instead of the physical file. You would do this by moving from the
> SF_NOTIFY_URL_MAP to the SF_NOTIFY_PREPROC_HEADERS notification.

[TJ]: This option will not work in our case. But is using HTTP Modules
(or Handlers) in such a situation helpful? I know this will only be
available for ASP.NET, but I cannot think of any other option.

Thanks,
Tarun


Re: IIS 6 | URL Mapping with ISAPI Filter | ASP.NET 2.0 by Wade

Wade
Fri Feb 23 18:08:43 CST 2007

Hi Tarun,

To answer your two questions:

1) Yes, this is a change between ASP.NET 1.1 and 2.0. And, no, I don't
think it can be toggled.

2) I am not familiar with the ASP.NET module API, but yes, I believe that
the mapping can be done there. As you say, this would be a solution that
only applies to ASP.NET.

Thank you,
-Wade A. Hilmo,
-Microsoft

"TJ" <tj_tronics@yahoo.com> wrote in message
news:1172148709.051886.37950@v33g2000cwv.googlegroups.com...
>
> Hi Wade,
>
> Thanks for the reply. Few more questions...
>
> > The problem is that ASP.NET 2.0 doesn't use the physical filename
provided
> > by IIS. It calculates the physical filename based on configuration
data.
>
> [TJ]: So isn't this change in behavior over ASP.NET 1.1 and ASP.NET
> 2.0 Request Processing? If it is, then is there any way this
> 'behavior' can be toggled?
>
> > The only way that I know of to make this work with ASP.NET 2.0 is to
rewrite
> > the URL instead of the physical file. You would do this by moving from
the
> > SF_NOTIFY_URL_MAP to the SF_NOTIFY_PREPROC_HEADERS notification.
>
> [TJ]: This option will not work in our case. But is using HTTP Modules
> (or Handlers) in such a situation helpful? I know this will only be
> available for ASP.NET, but I cannot think of any other option.
>
> Thanks,
> Tarun
>