Rewrite for subdomain

António P. P. Almeida appa at perusio.net
Sat Jan 7 22:51:11 UTC 2012


On 7 Jan 2012 19h11 WET, nginx-forum at nginx.us wrote:

> I want to set a rewrite rule for redirection of search.php?q=word to
> word.domain.com
> I used the following rule but did not work.

Try:

location ^~ /search.php {
   return 301 http://$arg_q.domain.com;       
}

--- appa



More information about the nginx mailing list