I'm trying to rewrite a path if the requested client is a mobile user. As per caddy documentation, this code should redirect a mobile user to the specified destination.
rewrite /redirect-me {
if {>User-Agent} has mobile
to /redirected
}
But it's wont when I add the User-Agent
condition. I tried other condition which works just fine. I tried to look for caddy available directives like User-Agent
but can't find a single hint.
I think it is likely {>User-Agent} is case sensitive.
try
{>User-agent}
and see if that works.