Dynamic URLs to Static?

Posted on 2005-05-07
Last Modified: 2010-04-07
I want to be able to convert my dynamic links (i.e. to static URLs (i.e., or 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?
Question by:ctudorprice
    LVL 5

    Accepted Solution


    Here's an article that will get you up and running: I would write more info for you, but it's all there for you. I quote, "URL rewriting can be implemented either with ISAPI filters at the IIS Web server level, or with either HTTP modules or HTTP handlers at the ASP.NET level. This article focuses on implementing URL rewriting with ASP.NET, so we won't be delving into the specifics of implementing URL rewriting with ISAPI filters" which deals with your problem with having more limited access to dealing with things on the server level.

    Note: "Since all of the HTTP modules will have been initialized prior to the custom HTTP handler factory being instantiated, using an HTTP handler factory presents the same challenges when placing the URL rewriting in the latter stages of the events—namely, file authorization will not work. So, if you rely on Windows authentication and file authorization, you will want to use the HTTP module approach for URL rewriting."


    Author Comment

    Thanks, Ted. MSDN: Why use a few words when a few thousand would do? I hate the Microsoft msdn articles. I find them but turning all the background info into a simple, implementable solution is always difficult. (That's why I come to EE for quick, simple answers).
    Here's what I did (simplified)... In the global.asax.vb:

    Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
    Dim incoming As HttpContext = HttpContext.Current
    Dim oldpath As String = incoming.Request.Path.ToLower
    if oldpath="/product/myproduct.aspx" then
    end if
    end sub
    LVL 5

    Expert Comment

    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.


    Author Comment

    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. 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 for the Application_BeginRequest to fire. Am I missing something?
    LVL 5

    Expert Comment

    So you were planning on putting one document per directory? How about posting your code, then I'm not barking up the wrong alley.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now