shorten the page address

C

c676228

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,
 
S

Steven Cheng

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:
(e-mail address removed).




--------------------
 
C

c676228

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.asp 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" said:
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:
(e-mail address removed).




--------------------
 
S

Steven Cheng

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:
(e-mail address removed).

==================================================
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==?= <[email protected]>
References: <[email protected]>
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?
 
C

c676228

Steven,

I think I got some of it.

Here is my customized 404 page. Basically what I did is
if a customer enters www.mydomain.com/wm67835
then it will be redirected to
http://www.mydomain.com/what/wmedhigh.asp?67835
67835 is just a sample of an agent code, we have hundreds of agents
my concern is with so many agents using www.mydomain.com/wmXXXXX
and each request will be gone through 404 page first then to the normal page.
will we be punished by Search Engine or other similar punisement?
what does 200 ok exactly mean?

but my question is if we have
--------------------------
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
 
C

c676228

Steven,

the following is from http://asp.johnavis.com/blog/default.asp?id=19
This RequestQS function call can get parameter's value.
I think this function call shoud be put in the customized 404 page in order
for those redirect working.
But why John says it needs to be put "Add the following function to the
beginning of each of your scripts that will use URL redirection:"
The page:
http://www.mydomain.com/param1name/param1value/param2name/param2value/page.asp
doesn't even exist and it will be redirect to ............../page.asp, right?
*****************************************
Add the following function to the beginning of each of your scripts that
will use URL redirection:


Function RequestQS(strParam) strQuery =
Request.ServerVariables("QUERY_STRING") lngStart = InStr(strQuery,"/" &
strParam & "/") RequestQS = "" If lngStart > 0 Then lngStart = lngStart +
Len("/" & strParam & "/") lngEnd = InStr(lngStart + 0, strQuery, "/") If
lngEnd > 0 Then RequestQS = Mid(strQuery, lngStart, lngEnd - lngStart) End
If End IfEnd Function

*********************
 
C

c676228

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
 
S

Steven Cheng

Hi Betty,

As for the redirection script, you only need to put it in the custom 404
page(an asp page) rather than put it in each asp page you want to remapping
its path.

Also, as for your afraid to be punished by search engines, do you mean that
you're worried that the 404 page approach will cause search engine to
receive 404 error instead of 200 code? For this scenario, I think you'd
better use some http monitoring tool(such as the IE web development helper
or fiddler) to verify the http response header(status code) to see how this
404 error page approach works.

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:
(e-mail address removed).

--------------------
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top