locked
how to loose the querystring by using a mod rewrite in ASP.NET RRS feed

  • Question

  • User-803162859 posted
    So what i'm aiming for is a way so I can rewrite the uri from a querystring into a standard url and when posted back to interprete the posback url into a querystring. I'm not sure this is the way to go but PHPers call it a mod rewrite.
    Tuesday, January 6, 2004 7:17 AM

All replies

  • User-886813230 posted
    Try using the RewritePath method associated with the HttpContext class. When used in an HttpModule, it allows you to modify the incoming URI so that, say, the elements of the path can be converted to querystring values. HTH
    Tuesday, January 6, 2004 11:11 AM
  • User-803162859 posted
    thx that's for the way in but how should it be done for the way out? And are there any samples available?
    Tuesday, January 6, 2004 2:55 PM
  • User-886813230 posted
    This might be a naive question, but why would you want to do it on the way out. Instead of having the links built using querystring, create them using the directory structure you would expect anyone to use. When clicked, the links will get translated to a querystring by the RewritePath logic. Or have I missed something simple here.
    Wednesday, January 7, 2004 3:16 PM
  • User-803162859 posted
    because some search engines don't rank pages with querystring as good as them with fixed paths.
    Wednesday, January 7, 2004 5:47 PM