Display .asp handler for .aspx pages

I am currently developing in Umbraco 4.7.

My client has a requirement to redirect classic ASP pages with the .asp extension to their new pages. I installed the following package:

URL redirection control http://our.umbraco.org/projects/backoffice-extensions/manage-url-redirects

These packages do exactly what I need with the .aspx pages and for those who don't have the extension.

However, when it comes to .asp, this does not work. My first thoughts are that this is because .asp is not configured to map to .aspx pages in the handler mapping configuration in IIS7.

In an attempt to resolve this, I added a new handler mapping in IIS.

  • Add Script Manager
  • Request path - * .asp
  • The executable file is C: \ windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ aspnet_isapi.dll
  • Title - ClassicAspToNet

Prior to adding this handler mapping, I received an IIS 404 error page. Now I get a server exception:

URL failed.

Example: * REMOTE LINK HERE *

Your help would be greatly appreciated if you could help me determine if it is possible to serve .aspx pages with the .asp extension, and if so, how can I do this?

Thanks in advance,

David.

+4
source share
3 answers

I had a similar problem with migrating PHP to Umbraco. My solution was to add a non-continued handler (wildcard matching), and then use UrlRewriting in Umbraco to remove .php and replace it with .aspx.

The rewrite rule is used here:

<add name="phptoaspx" virtualUrl="^~/(.*).php" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="/$1.aspx" ignoreCase="true" /> 

Perhaps in your case you just need to rewrite? You may need to remove .asp from the IIS handler mappings.

0
source

You can try the blog post that I wrote about how to reassign other extensions for IIS in Classic Mode and Integrated: http://blogs.msdn.com/b/carlosag/archive/2008/07/04/mappingfileextensionforaspxpagesiniis70. aspx

0
source

You can use the 301 Moved Permanently function in case this helps.

In the classic asp site, you have global.asa with an event like On On, you can redirect to the corresponding aspx file.

eg

 Sub Application_OnStart Declare a variable and Get page name from request and redirect accordingly Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.example.com/" + VariableNameThatHoldsPageName Response.End End Sub 

Hope this helps .....

0
source

All Articles