using intelligencia url re-writer in a classic asp webapp - asp.net

I have a classic asp webapp that I need to implement url re-writing in. I've used the intelligencia url re-writer in an asp.net application before , so my current trail of thought is to create a new asp.net application, add the url re-writing component to it and then add the classic asp application over the top. It's hosted in shared webspace so I have no ability to add isapi components to the webserver.
Is this the right way to go about it? What configuration changes would I need to make to get the classic asp and asp.net to sit together happly?
Any advice would be very appreciated.

You might be able to use a 404.asp to do this. I'm running HELM on IIS6 and can use my 404.asp like this:
URLPath = LCase(Replace(Request.Servervariables("QUERY_STRING"), "404;http://" & Request.ServerVariables("SERVER_NAME") & ":" & Request.Servervariables("SERVER_PORT"), ""))
If URLPath = "/lalala" Then
Response.Status="200 OK"
Response.Write "La la la!"
Else
Response.Status="404 Not Found"
Response.Write "File not found."
End If

Related

combine classic asp with asp.net

I have a (huge) website written in classic asp. Now do I have to switch to vb.net (razor). Is there a way to combine those 2 till the switch is complete ?
Is there a way to let the application work with classic asp and vb.net ?
(I use webmatrix)(don't know if this is important information)
The reason I ask this is because the website contains more than
MSDN says you can run .asp and .aspx on the same server
ASP and ASP.NET can both be used on the same Web server. That is, a
Web site or Web application within a site can contain both ASP.NET
pages and ASP pages. Because both ASP and ASP.NET pages can be
accessed from the same Web server, you are not required to port your
existing ASP pages over to ASP.NET-compatible pages. [...]
https://msdn.microsoft.com/en-us/library/ms973813.aspx

Asp Page in nested folder open like new website

Publish old project on asp, not asp.net, on new server with IIS 7.5
Site work correctly, but all pages in nested folders open like new web-application with error.
example: localhost/reports/all_tasks_report.asp
Error -
help pls.)
"This type of page is not served" means that Classic ASP is not enabled on your server. From IIS7 onwards it isn't enabled by default
http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on-iis

.asp handler mapping 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 have installed the following package:
Manage URL Redirects
http://our.umbraco.org/projects/backoffice-extensions/manage-url-redirects
This packages does exactly what I need with .aspx pages and for those without an extension.
However, when it comes to .asp this doesn't work. My first thoughts are that this is because .asp is not set up to map to .aspx pages within the handler mappings configuration within IIS7.
In an attempt to resolve this, I have added a new handler mapping to IIS.
Add Script Manager
Request Path - *.asp
Executable - C:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
Name - ClassicAspToNet
Prior to adding this handler mapping, I was receiving the IIS 404 error page. Now I receive a Server Exception:
Failed to Execute URL.
Example: * REMOVED LINK HERE *
Your help would be greatly appreciated in helping me determine whether it is possible to serve .aspx pages with a .asp extension, and if so, how do I do this?
Thanks in advance,
David.
I had a similar issue with a PHP to Umbraco migration. My solution was to add an extensionless handler (wildcard mapping) and then use the UrlRewriting in Umbraco to strip the .php and replace it with .aspx.
Here's the rewrite rule I used:
<add name="phptoaspx"
virtualUrl="^~/(.*).php"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="/$1.aspx"
ignoreCase="true" />
Perhaps in your case you just need the rewrite? You may need to remove the .asp from the IIS handler mappings though.
You can try the blog entry I wrote about how to remap other extensions to IIS in both Classic Mode and Integrated mode:
http://blogs.msdn.com/b/carlosag/archive/2008/07/04/mappingfileextensionforaspxpagesiniis70.aspx
You can use the 301 Moved Permanently feature in case if that helps.
In you classic asp site you have global.asa with event like On Application start, you can redirect to the the appropriate aspx file.
e.g
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 it helps.....

Response.write with classic ASP page on IIS7

The following statement will not work with a classic asp page on an IIS7 website
<% Response.Write("test") %>
Have you enabled ASP inside Windows features?
I figured out that it had to do with adding a handler mapping for server side includes. When I added a module mapping ServerSideIncludeModule with request path of *.asp, it broke my site.

ASP in a .html file under .net 4.0

I'm updating a site from asp.net 2.0 to asp.net 4.0.
I'm running IIS 7.0.
If I create test.asp and browse to it it works.
If I rename the file test.html it will not parse the asp.
I need html to be parsed as asp because of the CMS we use.
Relevant code from test.html:
<%
Response.Write ("The time on the server is: " & Time())
%>
I think my trouble comes from the way .net 4.0 handles requests.
How do I get IIS to parse html as asp?
You will need to associate the same DLL that currently handles your .asp pages to also handle your .html pages in IIS. see here for help with that
I don't see the connection between ASP and .NET here.
Are you trying to figure out why the ASP engine is not processing a file with the .HTML extension?
When you name a file with the .ASP extension, it will be processed by the ASP engine. When you name a file with some other extension, like .HTML, it will not be processed by the ASP engine so any ASP-specific markup in it will go through to the client.

Resources