1 -module(cl7_urlrewrite
).
2 -export([arg_rewrite
/1]).
4 -include_lib("yaws/include/yaws_api.hrl").
8 {abs_path
, Path
} = Req#http_request
.path
,
10 case string:rstr(Path
, ".html") of
12 N
-> "/?page=" ++ string:substr(Path
, 2, N
- 2) ++ string:substr(Path
, N
+ 5)
16 %{ok, F} = file:open("/tmp/out.txt", [write]),
17 %io:format(F, "~p~n", [Path]),
19 Arg#arg
{req
= Req#http_request
{path
= NPath
}}.