Currently I have a wildcard mapping to aspnet_isapi.dll in Win2003 IIS 6. I'd prefer to remove it from there and have it in my web.config. Is this possible?
I use custom module for url rewriting. I exclude all CMS workarea files and folder from custom urlrewriting module. If i have remove widcard configuartion in IIS6.0 drag and drop works and url rewriting not woking. Can any one help for me.
sub application_beginrequest()
If (Request.Url.ToString().ToLower().Contains("workarea") Or Request.Url.ToString().ToLower().Contains("aspnet_client") Or Request.Url.ToString().ToLower().Contains("assetmanagement") Or Request.Url.ToString().ToLower().Contains("assets") Or Request.Url.ToString().ToLower().Contains("privateassets")
Or Request.Url.ToString().ToLower().Contains("bin")) Then
Else
Rewrite(Request.RawUrl)
End If
End Sub
the above configuration setting works fine with Windows XP. I need to use wildcard configuration in WEB.config to work the URL Rewriting.
Currently I have a wildcard mapping to aspnet_isapi.dll in Win2003 IIS 6. I'd prefer to remove it from there and have it in my web.config. Is this possible?
Short answer: No. It's not possible. You must have a wild card mapping to make URL rewriting work.
Long answer: For your HttpModule to get a chance to do anything, ASP.NET must be called with the request. IIS is the program calling ASP.NET for certain requests. It determines which requests to call ASP.NET for via extension-mapping, i.e. .aspx is mapped
to ASP.NET and thus results in IIS calling ASP.NET. Most URL rewriting is about rewriting extension-less request paths. By definition, a wild-card mapping in IIS is the only way to tell IIS to call ASP.NET (or any other isapi extension). So - to make this
work, you must have a wild-card mapping (and you must also uncheck the 'check that file exist' checkbox).
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
Marked as answer by pkellner on Aug 25, 2008 02:09 AM
The same coding and other setup i was done in my XP System, except wildcard mapping with application in IIS. Instead of mapping in IIS I have done through WEB.CONFIG. it works in windows XP system.
I think you're saying that despite all it actually works in your Windows XP system.
My guess is that it works because you're running the Development Web Server in Visual Studio 2005 - it always has wild-card mapping enabled.
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
no. i don't think so. because i have config the wild-card mapping in windows XP system. After that i have remove that settings and given those setting in WEB.CONFIG.
If so means how could i enabled the wild-card mapping by default in Windows 2003 Server.
I think we have a natural language problem here I'm afraid, and we're talking around each other.
- To be able to work in ASP.NET with a URL that does not have an extension, such has
http://www.myserver.com/mypath/mywhatever you *must* have a wild-card mapping enabled in the web server. In Windows XP, this is IIS 5 or the Development Web Server. In Windows 2003 this is IIS 6 or the
Development Web Server. The Development Web Server *always* has wild-card mapping enabled. IIS 5 and IIS 6 *require* you to manually configure this.
- You can perform limited URL Rewriting without any IIS configuration if the URL in question already is mapped to ASP.NET. In practice I've never actually seen any application where this suffices.
- You say you have "remove that settings and given those setting in WEB.CONFIG" in your Windows XP / IIS 5. Can you please show just exactly what you have added to Web.Config ?
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
Here the following code that what we included in web.config and remove the wildcard configuration in windows XP/ IIS 5.1.
No you did not. You did that in Windows Vista/IIS 7. At least if it is to have any potential of effect. The <system.webServer> element is only supported in Windows Vista/IIS 7. IIS 7 adds a whole new level of integration between IIS and ASP.NET, and there
you indeed can as you have found out do things affecting IIS via Web.Config.
Although my personal experience in IIS 7 is limited, from reading the documenation it does not appear that this is a wild-card mapping either. It appears to map all requests to paths to files with the extension ".dll" to the IsapiModule, which is fair enough
- and identical to the the default configuration.
To summarize:
The addition you have made to <system.webServer> element in Web.Config has the following effect for the different Web Servers:
Windows XP/IIS 5 - None. The <system.webServer> element is not recognized, and thus ignored.
Windows 2003/IIS 6 - None. The <system.webServer> element is not recognized, and thus ignored.
Windows Vista/IIS 7 - None. The change is identical to the default configuration.
Visual Studio 2005/Development Web Server - None. The <system.webServer> element is not recognized, and thus ignored.
I should also add that if your question had related to IIS 7, then I do believe that you can do your wild-card mapping in Web.Config (but not like you tried above).
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
I need both functionalities (url rewrtiing and drag & drop).In our cms we have the drag and drop functionalities.But when i try url rewriting "wildcard configuration" drag and drop not supported.This "wildcard configuration" affects static files.Is there
any solutions or any changes needed in web.config file when we use wild card configuration.Can u suggest me that one.
saravanan.r
0 Points
6 Posts
Url ReWriting setting up in web.config
Aug 09, 2007 12:02 PM|LINK
Hi All,
Currently I have a wildcard mapping to aspnet_isapi.dll in Win2003 IIS 6. I'd prefer to remove it from there and have it in my web.config. Is this possible?
I use custom module for url rewriting. I exclude all CMS workarea files and folder from custom urlrewriting module. If i have remove widcard configuartion in IIS6.0 drag and drop works and url rewriting not woking. Can any one help for me.
sub application_beginrequest()
If (Request.Url.ToString().ToLower().Contains("workarea") Or Request.Url.ToString().ToLower().Contains("aspnet_client") Or Request.Url.ToString().ToLower().Contains("assetmanagement") Or Request.Url.ToString().ToLower().Contains("assets") Or Request.Url.ToString().ToLower().Contains("privateassets") Or Request.Url.ToString().ToLower().Contains("bin")) Then
Else
Rewrite(Request.RawUrl)
End If
End Sub
the above configuration setting works fine with Windows XP. I need to use wildcard configuration in WEB.config to work the URL Rewriting.
Thanks in Advance
Saravanan.R
Rex Lin - MS...
All-Star
17422 Points
2116 Posts
Re: Url ReWriting setting up in web.config
Aug 13, 2007 03:08 AM|LINK
HI,Saravanan.R:
I recommend you to check this article about Url rewritting in asp,net
http://www.codeproject.com/aspnet/URLRewriter.asp
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support
If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved
Svante
All-Star
18347 Points
2300 Posts
Re: Url ReWriting setting up in web.config
Aug 13, 2007 05:02 PM|LINK
Short answer: No. It's not possible. You must have a wild card mapping to make URL rewriting work.
Long answer: For your HttpModule to get a chance to do anything, ASP.NET must be called with the request. IIS is the program calling ASP.NET for certain requests. It determines which requests to call ASP.NET for via extension-mapping, i.e. .aspx is mapped to ASP.NET and thus results in IIS calling ASP.NET. Most URL rewriting is about rewriting extension-less request paths. By definition, a wild-card mapping in IIS is the only way to tell IIS to call ASP.NET (or any other isapi extension). So - to make this work, you must have a wild-card mapping (and you must also uncheck the 'check that file exist' checkbox).
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
saravanan.r
0 Points
6 Posts
Re: Url ReWriting setting up in web.config
Aug 13, 2007 06:29 PM|LINK
Thanks svante,
The same coding and other setup i was done in my XP System, except wildcard mapping with application in IIS. Instead of mapping in IIS I have done through WEB.CONFIG. it works in windows XP system.
Why let me know ?
Thanks
Saravanan.R
Svante
All-Star
18347 Points
2300 Posts
Re: Url ReWriting setting up in web.config
Aug 13, 2007 06:38 PM|LINK
I think you're saying that despite all it actually works in your Windows XP system.
My guess is that it works because you're running the Development Web Server in Visual Studio 2005 - it always has wild-card mapping enabled.
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
saravanan.r
0 Points
6 Posts
Re: Url ReWriting setting up in web.config
Aug 13, 2007 06:50 PM|LINK
no. i don't think so. because i have config the wild-card mapping in windows XP system. After that i have remove that settings and given those setting in WEB.CONFIG.
If so means how could i enabled the wild-card mapping by default in Windows 2003 Server.
Svante
All-Star
18347 Points
2300 Posts
Re: Url ReWriting setting up in web.config
Aug 13, 2007 07:44 PM|LINK
I think we have a natural language problem here I'm afraid, and we're talking around each other.
- To be able to work in ASP.NET with a URL that does not have an extension, such has http://www.myserver.com/mypath/mywhatever you *must* have a wild-card mapping enabled in the web server. In Windows XP, this is IIS 5 or the Development Web Server. In Windows 2003 this is IIS 6 or the Development Web Server. The Development Web Server *always* has wild-card mapping enabled. IIS 5 and IIS 6 *require* you to manually configure this.
- You can perform limited URL Rewriting without any IIS configuration if the URL in question already is mapped to ASP.NET. In practice I've never actually seen any application where this suffices.
- You say you have "remove that settings and given those setting in WEB.CONFIG" in your Windows XP / IIS 5. Can you please show just exactly what you have added to Web.Config ?
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
saravanan.r
0 Points
6 Posts
Re: Url ReWriting setting up in web.config
Aug 14, 2007 05:14 AM|LINK
Thanks svante.
Here the following code that what we included in web.config and remove the wildcard configuration in windows XP/ IIS 5.1.
<system.webServer>
<handlers accessPolicy="Script, Execute, Read">
<remove name="ISAPI-dll"/>
<add name="ISAPI-dll" path="*.dll" verb="*" type="" modules="IsapiModule" scriptProcessor="" resourceType="File" requireAccess="Execute" preCondition="" allowPathInfo="true"/>
</handlers>
</system.webServer>
The same above code is not working in Windows 2003 Server / IIS 6.0. We don't know why ? whether we have to set any optional param. or else ?
Assisst me in this regard.
Thanks
Saravanan.R
Svante
All-Star
18347 Points
2300 Posts
Re: Url ReWriting setting up in web.config
Aug 14, 2007 06:01 AM|LINK
No you did not. You did that in Windows Vista/IIS 7. At least if it is to have any potential of effect. The <system.webServer> element is only supported in Windows Vista/IIS 7. IIS 7 adds a whole new level of integration between IIS and ASP.NET, and there you indeed can as you have found out do things affecting IIS via Web.Config.
Although my personal experience in IIS 7 is limited, from reading the documenation it does not appear that this is a wild-card mapping either. It appears to map all requests to paths to files with the extension ".dll" to the IsapiModule, which is fair enough - and identical to the the default configuration.
To summarize:
The addition you have made to <system.webServer> element in Web.Config has the following effect for the different Web Servers:
Windows XP/IIS 5 - None. The <system.webServer> element is not recognized, and thus ignored.
Windows 2003/IIS 6 - None. The <system.webServer> element is not recognized, and thus ignored.
Windows Vista/IIS 7 - None. The change is identical to the default configuration.
Visual Studio 2005/Development Web Server - None. The <system.webServer> element is not recognized, and thus ignored.
I should also add that if your question had related to IIS 7, then I do believe that you can do your wild-card mapping in Web.Config (but not like you tried above).
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
saravanan.r
0 Points
6 Posts
Re: Url ReWriting setting up in web.config
Aug 14, 2007 06:38 AM|LINK
thanks for reply,
I need both functionalities (url rewrtiing and drag & drop).In our cms we have the drag and drop functionalities.But when i try url rewriting "wildcard configuration" drag and drop not supported.This "wildcard configuration" affects static files.Is there any solutions or any changes needed in web.config file when we use wild card configuration.Can u suggest me that one.
with regards,
Saravanan