Fwd: Yaws / mod_rewrite alternative

Claes Wikstom klacke@REDACTED
Thu Jul 21 16:40:12 CEST 2005


Dale Harvey wrote:
> Hey
> 
> Coming from a php/apache background, I was wondering if there was any
> simple way to emulate mod_rewrite in yaws,
> 
> I would like all pages on a site server from a single function, where
> i can parse the url manually to get the input i need.
> 
> appmod will allow me to internally redirect the request, but it does
> so regardless of extension, and I havent been able to find a way
> around this, from what i can gather I cant serve css / jpg files from
> out/1 as it needs a {html or {ehtml tuple returned, and even if it
> were possible it doesnt seem like the best solution
> 

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.



> basically what i want is
> RewriteRule !\.(gif|jpg|png|css|js)$ mymodule:out(A)
>

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.



All in all, I think you need to tell us better what it is you
want to do.


/klacke
It may solve your problems .....



/klacke



More information about the erlang-questions mailing list