Forum Moderators: open
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.
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.
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" ThenResponse.Status = "301 Moved Permanently"Response.addheader "Location", "page.asp"Response.EndEnd 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
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.
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
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.