Forum Moderators: open

Message Too Old, No Replies

Page lists

         

stevelibby

8:11 am on May 18, 2006 (gmt 0)

10+ Year Member



My web site is written in asp.when results are returned they are in batches of 25. To select the 2nd batch the href is:
page.asp?Page=2
However moving through the results are fine but coming back page.asp & page.asp?page=1 maybe deemed as duplicate content by search engines?
How can i get around this isssue?

1010matt

1:16 pm on May 18, 2006 (gmt 0)

10+ Year Member



Use url rewriting. I use ISAPI Rewrite. Another one is mod_rewrite.

Basically you hide your parameters in the static url, e.g.:

Your original URL: www.yoursite.com/page.asp?page=2

The one you use instead: www.yoursite.com/2/page.htm

This is search engine friendly because every page looks like a static page to se.

stevelibby

1:27 pm on May 18, 2006 (gmt 0)

10+ Year Member



Hi
How do i do that then? Would you mind walking me through how i do it?

1010matt

1:49 pm on May 18, 2006 (gmt 0)

10+ Year Member



1. Search for "isapi rewrite" in your preferred search engine.

2. Install the ISAPI filter on your server.

3. Decide on a static URL format. It's up to you. Use my previous example if you like.

4. Modify you ASP/HTML to link to the static URL. For example, on your page.asp that returns the first 25 results you will have a 'next page' link similar to this: <a href="/page.asp?page=2">next page</a>. Change this to <a href="/2/page.htm">next page</a>.

5. Write a rule for the rewrite filter that translates /2/page.htm to /page.asp?page=2

Most companys who sell these isapi filters have forums with loads of examples.

ps move to ASP.NET 2.0 as soon as you can. Classic ASP is like Shakespearean English - no one speaks it anymore.

stevelibby

2:13 pm on May 18, 2006 (gmt 0)

10+ Year Member



Hi mat
I am on shared platform thopugh, will that matter?

mrMister

4:14 pm on May 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am on shared platform thopugh, will that matter?

Yes. You will have to get your hosting provider to install the rewriting software. The software can be enabled on a site by site basis, so most decent hosting providers won't mind installing it.

It is possible to do rewriting without additional software but it can be quite complicated and requires a fair amount of programming (more so in classic ASP than .Net)

Anyway, having said all of that. URL rewriting won't solve your specific problem. The quickest way to solve it would be to put something like this at the top of your page...


If Request.querystring("page") = "1" Then

 Response.Status = "301 Moved Permanently"

 Response.addheader "Location", "page.asp"

Response.End

End If

It's not the most efficient way, but it is the easiest and will avoid duplicate content issues in search engines.

ps: If it ain't broke don't fix it. No need to move to ASP.Net if you don't need to :p

flyerguy

11:47 am on May 20, 2006 (gmt 0)

10+ Year Member



"ps: If it ain't broke don't fix it. No need to move to ASP.Net if you don't need to :p "

I have a newly acquired library of books on .NET 2, and have serious plans to upgrade my flagship classic ASP site. I'm planning a little mid-summer hiatus in a sunny place to make the gameplan.

I am having troubles though making a business case for it to myself. Sure I can clean up the user interface, throw in a lot of AJAX and upgraded schnick schnack.. but in the end I can't see the pages loading that much quicker nor my workload as admin decreasing substantially.

I'm not copping out, the upgrade job WILL get done. However with a finely tuned classic ASP site you can still make a lot of $ in this world, even in 2006.

defanjos

11:49 pm on May 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



somewhere on the paging script you should have a variable like "pageno" that tells you what page you are on.

All you have to do is something like the following (code not correct, just logic):

if pageno - 1 = 1 then
link "Previous Page" to "page.asp"
else
link "Previous Page" to "page.asp" & "?page=" & pageno - 1
end if

This way you won't have links to page.asp?page=1, just page.asp

defanjos

11:52 pm on May 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



sorry, duplicate entry

ctudorprice

3:03 pm on May 23, 2006 (gmt 0)

10+ Year Member



if you are on asp.net 2.0 you can rewrite the urls in your app - without clunky isapi rewrite.

try HttpContext.Current.RewritePath() function in the Application_BeginRequest procedure in Global.asax.vb.

here you can intercept the inbound/requested paths and map them to whatever you want.

for example:

if httpcontext.current.request.path="/sony-dp-105.aspx" then
HttpContext.Current.RewritePath("/product.aspx?id=123")
end if

you can do a lot more with this - i.e. look up products/ids from a database etc. etc. or have external lookup files.