Fwd: Yaws / mod_rewrite alternative
Dale Harvey
harveyd@REDACTED
Thu Jul 21 17:46:17 CEST 2005
> Hmm, you want dynmically generated css/jpg files
> shipped by yaws. I'm not sure how to to do that since
> it's the .yaws extension which makes yaws invoke
> the out/1 function and everything.
>
Im invoking out/1 from appmod in yaws.conf,
> Take a look at
>
> # man yaws.conf
>
> arg_rewrite_mod = Module
> It is possible to install a module that rewrites all the Arg
> #arg{} records at an early stage in the yaws server. This can
> be used to do various things such as checking a cookie, rewrit-
> ing paths etc.
>
Heh yeh i noticed that, but erlang / yaws docs + google doesnt make
anymore mention of it, or at least that i can find
> All in all, I think you need to tell us better what it is you
> want to do.
I want all "pages" on a site served by a single function
www.domain.com/ - served by mymodule:out(A)
www.domain.com/home/ - served by mymodule:out(A)
www.domain.com/anything/else - served by mymodule:out(A)
and all files, css, images, js just given the actual file
www.domain.com/style.css - to just send style.css
I got it working, but its not the nicest solution, a series of
appmod = <"home",mymodule>
appmod = <"contact",mymodule>
ect ect for each top level section
and a rewrite for root ( I cant find how to just to <"/",mymodule>
then i can just check is _regular(docroot++appmoddata),
and redirect_local if it is a file, else check the url and send back html
arg_mod_rewrite does seem like it would have the solution I want
though, I just cant find anymore information on it
Cheers
Dale
More information about the erlang-questions
mailing list