[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rewriting URLs



Just send all requests through userspace by
echo 1 > /proc/sys/net/tux/all_userspace

Then your module can easily do the rewrite.  Look at demo2.c, and
change the req so that TUX_ACTION_GET_OBJECT is looking up the
modified URL and do other relevant changes (i.e. not text/html)
and you'll have basically what you are looking for.

michaelkjohnson

 "He that composes himself is wiser than he that composes a book."
 Linux Application Development                     -- Ben Franklin
 http://people.redhat.com/johnsonm/lad/


kdebisschop writes:
>I would like to create a userspace module that rewrites a URL.
>
>Spceficically, whenever TUX gets a request for
>
>	/images/clearpix.gif
>
>I want to send the file
>
>	/images/c/l/e/a/clearpix.igf
>
>The code is simple enough, but I have not been able to identify a way to
>casue TUX to know that if should invoke the userspace module when it
>sees that kind of URL. Essentailly, I'd like to define a tux.mime/type
>based on the head of the URL, rather than the file extension, and
>associate that to a module.
>
>It may help that all requests could be process through this single
>userspace module -- the machine would always be serving images.
>
>Any suggestions on how I can make this happen.
>
>(BTW - I am fairly new to TUX. Maybe this is obvious, in which case a
>pointer would be much appreciated. Maybe it is hard, in which case we
>would gladly consider hiring any consultants who may be lurking on the
>list here)
>
>
>-- 
>Karl DeBisschop
>Learning Network / Information Please
>www.learningnetwork.com / www.infoplease.com
>
>
>
>_______________________________________________
>tux-list mailing list
>tux-list@redhat.com
>https://listman.redhat.com/mailman/listinfo/tux-list
>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []