> Classic "redirect everything" example contains > '?'. See e.g. here: > > http://nginx.org/en/docs/http/converting_rewrite_rules.html > > : server { > : listen 80; > : server_name nginx.org; > : rewrite ^ http://www.nginx.org$request_uri?; > : } Well, it sure does. http://wiki.nginx.org/Pitfalls#Taxing_Rewrites does notby NCRonB - Nginx Mailing List - English
I've been using the following code to redirect non-www to www-refixed domains: server { server_name example.com; rewrite ^ http://www.example.com$request_uri permanent; } However, I just realized that when there is a query string, the resulting URI has the query string twice. For example: http://example.com/test.html?a=1&b=2 ...is rewritten as: http://www.exampleby NCRonB - Nginx Mailing List - English