Swindle, knob springs to mind, read the blooming question and try desperately hard not give dicky answers
Thank you
Max
Main Topics
Browse All TopicsI want to create a 404 to redirect the requested htm file to an exact asp equivalent
so if they enter
www.sitename.com/folder/pa
I found this example, but it doesnt seem to work
<%
dim newFilename
newFilename=request.Server
newFilename = replace(newFilename, "404;http://", "")
newFilename = right(newFilename, instr(newFilename,"/")-1)
newFilename = left(newFilename,instrRev(
newFilename =newFilename & "asp"
server.transfer(newFilenam
%>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
And you do get something in return, points and as you well know, points is questions and ultimately someones time, so just spend a minute of a moment longer reading the question, you will probably get a lot more points, that is if you can answer them to begin with? Is my hammer getting close to the head?
Just for the record, I have managed to build my own as it seems INCREDIBLY difficult to find anything on the net like this, for a reason I have yet to discover.
here goes
<%
Dim strQuery, strRedirectURL
strQuery = Request.ServerVariables("Q
If Right(strQuery, 4) = ".htm" Then
strRedirectURL = Replace(strQuery, ".htm", ".asp")
strRedirectURL = Replace(strRedirectURL, "404;", "")
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", strRedirectURL
else
Response.Redirect "http://www.yourwebsite.co
End If
%>
Try doing this instead...
<%
tmpError = Request.ServerVariables("q
IF tmpError <> "" THEN
intLength = (inStr(1, tmpError, "http://")) - 1
theError = Left(tmpError, intLength)
tmpPage = replace(tmpError,"404;http
intLength = Len(tmpPage) - (inStr(1, tmpPage, "/")) + 1
thePage = Right(tmpPage, intLength)
Response.redirect(page_red
End If
%>
Business Accounts
Answer for Membership
by: SwindlePosted on 2007-08-28 at 08:27:31ID: 19783952
The problem is that if they are hitting a .html page the server is going to run it as html, not ASP. The easiest option I've found to do this is just create a page.htm and have it redirect them to the page.asp. In my case I want my user to know they goofed up though and I'll usually delay the redirect for 5 seconds and show them a message explaining they will be redirected and suggesting they update their bookmarks etc.
<META HTTP-EQUIV="Refresh"
CONTENT="5; URL=html-redirect.html">