ctudorprice
asked on
Dynamic URLs to Static?
Hi
I want to be able to convert my dynamic links (i.e. http://www.mysite.com/products/product.aspx?ID=145) to static URLs (i.e. http://www.mysite.com/products/products/ID/145, or http://ww.mysite.com/products/145.htm) or something similar that will get indexed by the search engines, obviously without actually producing static pages for all of the produts.
Is there any easy way of doing this? I've seen some ISAPI products that seem to suggest that they do this... My site is hosted elsewhere, so I am not sure I can install ISAPI or other (non ASP.NET) solutions.
Anyone have any tricks/tips?
Thanks....
I want to be able to convert my dynamic links (i.e. http://www.mysite.com/products/product.aspx?ID=145) to static URLs (i.e. http://www.mysite.com/products/products/ID/145, or http://ww.mysite.com/products/145.htm) or something similar that will get indexed by the search engines, obviously without actually producing static pages for all of the produts.
Is there any easy way of doing this? I've seen some ISAPI products that seem to suggest that they do this... My site is hosted elsewhere, so I am not sure I can install ISAPI or other (non ASP.NET) solutions.
Anyone have any tricks/tips?
Thanks....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sounds good ctudorprice. Nice summary ;-)
Hopefully you don't have reams of code to cover all your pages - you could modify the above so that it just parses it all together: i.e. productlister1.aspx, which would cover all pages with less code, but if you've just got a few pages, much nicer result.
Ted
Hopefully you don't have reams of code to cover all your pages - you could modify the above so that it just parses it all together: i.e. productlister1.aspx, which would cover all pages with less code, but if you've just got a few pages, much nicer result.
Ted
ASKER
Hi ovalsquare,
the solution I implemented does actually parse the inbound URL...
One thing I was hoping to do was to be able to use directories (i.e. http://www.mysite.com/product/1/) but it appears that the server looks for a default document in that dir before the Application_BeginRequest fires. So now, I have to code the URLs as http://www.mysite.com/product/1.aspx for the Application_BeginRequest to fire. Am I missing something?
the solution I implemented does actually parse the inbound URL...
One thing I was hoping to do was to be able to use directories (i.e. http://www.mysite.com/product/1/) but it appears that the server looks for a default document in that dir before the Application_BeginRequest fires. So now, I have to code the URLs as http://www.mysite.com/product/1.aspx for the Application_BeginRequest to fire. Am I missing something?
So you were planning on putting one document per directory? How about posting your code, then I'm not barking up the wrong alley.
Ted
Ted
ASKER
Here's what I did (simplified)... In the global.asax.vb:
Sub Application_BeginRequest(B
Dim incoming As HttpContext = HttpContext.Current
Dim oldpath As String = incoming.Request.Path.ToLo
if oldpath="/product/myproduc
incoming.RewritePath("/pro
end if
end sub