Thanks for the replies. I only discovered it by accident - I assumed
that the default would be 301. Don't you think this should be the
default? I know that I rarely need a 302.
Maybe 301 vs 302 could simply be implemented by using something like ":"
& "::" vs "=" & "==" (just a thought).
Most of my sites are driven by a custom 404 handler so I would actually
use this for pages instead of any native server method. My main concern
is redirecting domain.tld to www.domain.tld.
I can easily implement an arg_rewrite in the server config for all the
non www domains but I'm new to YAWS/Erlang and I don't know how to do
this. I can't even find a function reference (Googling for
"url_decode_q_split" for example gets me nowhere).
Logically, this is what is needed:
Get the request
Extract the http protocol
Extract the http host
if(string:to_lower(string:sub_string(host,1,3)) != "www")
send a 301 header
redirect to protocol+"www"+host
Any help would be greatly appreciated.