[plt-scheme] url rewriting

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Jun 7 19:53:07 EDT 2007

Yes, it is possible.

Implement a custom dispatcher [1] that does the rewriting, then use
your own dispatching sequencing and put the rewriting dispatcher at
the start. Everything "will just work". Send me the code and I can
then integrate it. Basically you want:

; make : (url? -> url?) (conn? req? -> void) -> (conn? req? -> void)
(define (make url->url inner)
 (lambda (conn req)
  (inner conn (update-request-url req (url->url (request-url req))))))

Jay

1. See new documentation, in SVN after `mzscheme -mvt
docs/doc-installer.ss' or online at:

http://jay.teammccarthy.org/tmp/web-server-reference/dispatchers.html#(part%20dispatchers)

On 6/7/07, Hans Oesterholt-Dijkema <hdnews at gawab.com> wrote:
> L.S.,
>
> Is it possible to implement url rewriting with the PLT Webserver?
> I'd like to rewrite things like:
>
> http://x.y.z/somepage.html
>
> to
>
> http://x.y.z/servlets/program?page=somepage
>
> Preferably without seeing it at the outside; except when the servlet
> really becomes "active",
> i.e. is used in a continuation style fashion to handle forms.
>
> --Hans
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


-- 
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.teammccarthy.org


Posted on the users mailing list.