mod_rewrite

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • beachboy

    #1

    mod_rewrite

    Do dotnet have a module as apache's mod_rewrite??
    if yes, will server performance downgrade??

    Thanks in advanced.


  • Peter Bromberg [C# MVP]

    #2
    RE: mod_rewrite

    No, but it has the infrastructure to do it. It's called "URL Rewriting".
    You can find some example code easily by searching on "ASP.NET" "URL
    Rewriting".
    What exactly is it that you need to do?
    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:

    UnBlog:





    "beachboy" wrote:
    [color=blue]
    > Do dotnet have a module as apache's mod_rewrite??
    > if yes, will server performance downgrade??
    >
    > Thanks in advanced.
    >
    >
    >[/color]

    Comment

    • beachboy

      #3
      Re: mod_rewrite

      Thanks for your advise.

      I want to rewrite the url bcoz my unique id (GUID) is too long and google
      will stop to search such long long url
      Anyone did it previously???

      Thanks.

      "Peter Bromberg [C# MVP]" <pbromberg@yaho o.nospammin.com > ¦b¶l¥ó
      news:9C6377A0-3CE5-4049-BD8E-DE94FBAE0D78@mi crosoft.com ¤¤¼¶¼g...[color=blue]
      > No, but it has the infrastructure to do it. It's called "URL Rewriting".
      > You can find some example code easily by searching on "ASP.NET" "URL
      > Rewriting".
      > What exactly is it that you need to do?
      > Peter
      >
      > --
      > Co-founder, Eggheadcafe.com developer portal:
      > http://www.eggheadcafe.com
      > UnBlog:
      > http://petesbloggerama.blogspot.com
      >
      >
      >
      >
      > "beachboy" wrote:
      >[color=green]
      > > Do dotnet have a module as apache's mod_rewrite??
      > > if yes, will server performance downgrade??
      > >
      > > Thanks in advanced.
      > >
      > >
      > >[/color][/color]


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: mod_rewrite

        beachboy <steambun@hello kitty.com> wrote:[color=blue]
        > I want to rewrite the url bcoz my unique id (GUID) is too long and google
        > will stop to search such long long url
        > Anyone did it previously???[/color]

        If you rewrite the URL, surely you'll lose the uniqueness unless you're
        very careful.

        One alternative would be to make your app use shorter URLs by encoding
        the GUID in a different way. You can cut down the space taken by using
        Base64 encoding, and knocking off the trailing "==" (which you can put
        back yourself very easily). You'd end up going down from 36 characters
        to 22, assuming you're using Guid.ToString() (effectively).

        Call Convert.ToBase6 4String (guid.ToByteArr ay()) and then trim the last
        two characters. On the reverse side, add the "==" back on the end, call
        Convert.FromBas e64String, and then call new Guid (bytes).

        --
        Jon Skeet - <skeet@pobox.co m>
        http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
        If replying to the group, please do not mail me too

        Comment

        Working...