RE: shorten the page address

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Steven,

By using 404 page, will it hurt our web page because of search engine
indexing?
I am not sure what 200 Ok will do in response.
Could you explain a bit?
We are so afraid of being punished since we have hundreds of agents.
with redirect from
mydomain.com/wmXXXXXX
to mydomain.com/what/wmedhigh.asp?XXXXXX

with XXXXXX will be replaced with different agent number
Here is my version of customized 404 page:

qstr = Request.ServerVariables("QUERY_STRING")
strPage = Mid(qstr , InStrRev(qstr , "/") + 1)
Fst2strPage=Left(strPage, 2)
If Fst2strPage="wm" Then
PONumber=Right(StrPage, Len(strPage)-2)

If isNumeric(PONumber) and Len(PONUmber)<7 Then
Response.Status="200 OK"
Response.Redirect("http://www.mydomain.com/what/wmedhigh.asp?"&Ponumber)

'Server.Transfer("http://www.mydomain.com/what/wmedhigh.asp";)
Else
Response.Redirect("http://www.mydomain.com/404Page.htm";)
End If
Else
Response.Redirect("http://www.mydomain.com/404Page.htm";)
End If

--
Betty


""Steven Cheng"" wrote:

Hi Betty,

The article you mentioned is describing a method for url rewriting in
classic asp page. And that method take advantage of the IIS 404 error page.
When the IIS receive a request which doesn't have a valid server document
mapping to it, it will generate a 404 "not found" error, and here we can
configure the IIS to use a custom 404 error page. That means whenever the
client request a non-existing file/page, our custom error page will be
executed. So we can use an asp page as the 404 error page and do our URL
redirection logic there. For creating a custom 404 error page, you can
have a look at the following articles:

#Creating a Custom 404 Error Page
http://www.4guysfromrolla.com/webtech/061499-1.shtml

#How to Create a Custom 404 Error Page in Microsoft IIS
http://ask.enquiro.com/2008/how-to-create-a-custom-404-error-page-in-microso
ft-iis/

So for the following redirect case:

http://www.mydomain.com/param1name/param1value/param2name/param2value/page.a
sp is actuall a url which doesn't even exists on the IIS server, when the
IIS server recieve this request, it will generate 404 error and call our
custom 404 error page(could be an asp page), and in that error page we can
redirect the request to other page(such as the following one) according to
the querystring parameters.

http://www.mydomain.com/page.asp?param1name=param1value

If you still have anything unclear, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: =?Utf-8?B?YzY3NjIyOA==?= <betty@xxxxxxxxxxxxxxxx>
References: <B0C78B68-40F9-420C-AF80-EF23AFDA03D7@xxxxxxxxxxxxx>
<uLWlXHxxJHA.664@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: shorten the page address
Date: Tue, 28 Apr 2009 15:42:02 -0700

Steven,

Nice to hear from you again.
I am reading this page:

http://asp.johnavis.com/blog/default.asp?id=19

i don't really understand the following part:
/*****************
Use the following script in your custom error page:


strQuery = Request.ServerVariables("QUERY_STRING")
strPage = Mid(strQuery, InStrRev(strQuery, "/") + 1)

'betty--the above two statements should be
URL=Request.ServerVariables("URL")
strPage = Mid(URL, InStrRev(URL, "/") + 1) 'or did I misunderstand him?

' Change page.asp and page2.asp and add duplicate lines for
' each page you want redirection
If strPage = "page.asp" Then
Response.Status="200 OK"
Server.Transfer("/page.asp")
ElseIf strPage = "page2.asp" Then
Response.Status="200 OK"
Server.Transfer("/page2.asp")
Else '
Put your normal error page here
End If
URL=Request.ServerVariables("URL")
strPage = Mid(URL, InStrRev(URL, "/") + 1)
*****************

In his Funciton RequestQS, is he trying to demo this
http://www.mydomain.com/param1name/param1value/param2name/param2value/page.a
sp page will be
redirected to
http://www.mydomain.com/page.asp?param1name=param1value

I guess I missed something. In order to redirect in this way, does that
mean
we need to create a page
param1name/param1value/param2name/param2value/page.asp page, right?
If we have many this kind of pages, we need to create all actual pages?
--
Betty


""Steven Cheng"" wrote:

Hi Betty,

I think what you need is the URL-rewriting approach which redirect some
user/search engine friendly url to the underlying/actual complicated
url.
For IIS hosted http web application, you can use custom isapi filter to
perform url-rewriting.

#Product overview
http://www.isapirewrite.com/

#ISAPI Rewrite 2.0--URL Rewriting for Windows Server IIS
http://www.seoconsultants.com/windows/isapi/

Also, here are some article discussing on classic ASP url-rewriting
methods:

http://asp.johnavis.com/blog/default.asp?id=19

http://www.webmasterworld.com/microsoft_asp_net/3740259.htm

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments
and
suggestions about how we can improve the support we provide to you.
Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx




--------------------
From: =?Utf-8?B?YzY3NjIyOA==?= <betty@xxxxxxxxxxxxxxxx>
Subject: shorten the page address
Date: Fri, 24 Apr 2009 13:01:02 -0700

Hi all,

If the web address is really long, i.e.
mydomain.com/what/productName/myprogram.asp?ComplicatedStringValue
and I wan to shorten it. I can create a shorter web address
like this:

mydomain.com/myProgram1.asp?ComplicatedStringValue
in this new page, I just redirect this page to
mydomain.com/what/productName/myprogram.asp?ComplicatedStringValue

Are there any other ways doing that?

Thanks,

--
Betty






.



Relevant Pages

  • RE: shorten the page address
    ... When the IIS receive a request which doesn't have a valid server document ... configure the IIS to use a custom 404 error page. ... So for the following redirect case: ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.inetserver.asp.general)
  • Re: Custom not found and HTTP status code
    ... It's because of the way that ISAPI works with IIS. ... In order for an IIS status code to be redirected to a custom page without a ... you can no longer redirect without a 302. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Redirecting OWA Port 80 to 443
    ... When you use http://*** URL for the OWA with SSL, IIS will return the ... owahttps.asp (the redirect page) directly. ... Locate to the physical folder of "owa_redirect", open its permission ... Microsoft Online Partner Support ...
    (microsoft.public.exchange.admin)
  • IIS Log / Custom Error database discrepancies
    ... We currently have custom error logging setup on all of our websites. ... have IIS setup to redirect to our custom 500-100.asp page which logs the ... error to a database and then redirects to a friendly error message page. ... Would IIS log an error and not redirect to our custom 500-100.asp page? ...
    (microsoft.public.inetserver.asp.general)
  • Re: Redirect to error page
    ... IIS and I'd lean towards giving IIS the resposibility of returning 403 ... response object of your custom "forbidden" page. ... want to do is simply redirect the user to a standard error page. ... Dylan Parry - http://webpageworkshop.co.uk ...
    (microsoft.public.dotnet.languages.csharp)