Redirecting request

S

schoenfeld1

I have a broken link on my site for an "INSTALL.MSI".

How can I redirect all requests for "INSTALL.MSI" to "INSTALL.EXE" by
modifying the web.config?

Any help appreciated...
 
S

Siva M

Try this:

<configuration>
<system.web>
<urlMappings enabled="true">
<add url="~/installer.msi" mappedUrl="~/installer.exe"/>
</urlMappings>
</system.web>
</configuration>

I have a broken link on my site for an "INSTALL.MSI".

How can I redirect all requests for "INSTALL.MSI" to "INSTALL.EXE" by
modifying the web.config?

Any help appreciated...
 
G

Guest

Try this, place between <system.web></system.web>
<system.web>
<urlMappings enabled="true">
<clear />
<add url="~/INSTALL.MSI" mappedUrl="~/INSTALL.exe" />
</urlMappings>
</system.web>

Regards
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
 
S

schoenfeld1

Muhammad said:
Try this, place between <system.web></system.web>
<system.web>
<urlMappings enabled="true">
<clear />
<add url="~/INSTALL.MSI" mappedUrl="~/INSTALL.exe" />
</urlMappings>
</system.web>

Thanks for the reply (Siva too).

Unfortunately, it does not seem to work. Here is my web.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="GET,HEAD" path="*.config"
type="System.Web.StaticFileHandler" />
</httpHandlers>
<urlMappings enabled="true">
<clear />
<add url="~/installer.msi"
mappedUrl="~/installer.exe"/>
</urlMappings>
</system.web>
</configuration>


Any idea why this would fail? (I've restarted IIS and copied files to
root web folder).
 
S

schoenfeld1

Muhammad said:
Try this, place between <system.web></system.web>
<system.web>
<urlMappings enabled="true">
<clear />
<add url="~/INSTALL.MSI" mappedUrl="~/INSTALL.exe" />
</urlMappings>
</system.web>


Tracked down the error:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'urlMappings'

Source Error:

Line 5: <add verb="GET,HEAD" path="*.config"
type="System.Web.StaticFileHandler" />
Line 6: </httpHandlers>
Line 7: <urlMappings enabled="true">
Line 8: <add url="~/installer.msi"
mappedUrl="~/installer.exe"/>
Line 9: </urlMappings>


Source File: E:\web\app\htdocs\web.config Line: 7

Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300
 
S

Siva M

Sorry, urlMappings is an ASP.NET 2.0 feature. However, this could be
implemented in ASP.NET using HTTP modules. A sample is here:
http://pietschsoft.com/blog/post.aspx?postid=717


Muhammad said:
Try this, place between <system.web></system.web>
<system.web>
<urlMappings enabled="true">
<clear />
<add url="~/INSTALL.MSI" mappedUrl="~/INSTALL.exe" />
</urlMappings>
</system.web>


Tracked down the error:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'urlMappings'

Source Error:

Line 5: <add verb="GET,HEAD" path="*.config"
type="System.Web.StaticFileHandler" />
Line 6: </httpHandlers>
Line 7: <urlMappings enabled="true">
Line 8: <add url="~/installer.msi"
mappedUrl="~/installer.exe"/>
Line 9: </urlMappings>


Source File: E:\web\app\htdocs\web.config Line: 7

Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300
 
G

Guest

Wiered, try to map to any aspx page, just for testing.
and also create new project and try it on the new project
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
 
G

Guest

Yes, it only happen with IIS not the VWD webserver.
Well to resolve this I've done the following:
1) create dummy file .msi
2)from IIS I mapped .msi
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
right click on your web site, click on cofiguration button, you can do the
above from the mapping tab.
3) keep your web.config setting as we mentioned.

test and give us a feed back

regards

Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top