if (req.http.host ~ "^(.+?\.){2}fiddle\.") { set req.url = regsub(req.url, "/", "/subcontent/"); } #Here we check for a subdomain and rewrite the URL path from "/" to "/subcontent/"