>>> Is it possible to disable / ignore / redirect all URLs >>> with any query string? My site doesn't use query strings, >>> and is suffering from blog spam links >>> ... >> server { >> if ($args != '') { >> return 301 $uri; > > This will not work for complex $uri which requires encoding. > >> # OR >>by miles - Nginx Mailing List - English
Hello all, Is it possible to disable / ignore / redirect all URLs with any query string? My site doesn't use query strings, and is suffering from blog spam links as described by these folks: How do I remove spam from my blog's Google Blog Search results? http://www.google.com/support/forum/p/Webmasters/thread?tid=126184f38f712907&hl=en Google has the wrong (somewhat vulgar) URL for my site!by miles - Nginx Mailing List - English
All these location like location /docs.html { rewrite /docs.html /docs/ permanent; } location /quotes.html { rewrite /quotes.html /docs/quotes.html permanent; } it's better to change to location = /docs.html { rewrite ^ /docs/ permanent; } location = /quotes.html { rewrite ^ /docs/quotes.html permanent; } Done - thanks so much for pointing that out, Igor!by miles - Nginx Mailing List - English
location ^~ /weblog/ { rewrite ^/weblog/(.*) /blog/$1 permanent; } location ~ ^/weblog/(.*) { rewrite ^ /blog/$1 permanent; } You should use the first method. Thanks so much, Igor - will do!by miles - Nginx Mailing List - English
location ^~ /weblog/ { rewrite ^/weblog/(.*) /blog/$1 permanent; } I believe there's also a way to use regex captures in the location. I've not used this method yet, but I believe it's something like this: location ~ ^/weblog/(.*) { rewrite ^ /blog/$1 permanent; } Both solutions appear to work perfectly! Thanks so much, Nick!by miles - Nginx Mailing List - English
this rewrite looks ok, could you show whole server{} config? Thanks for asking - I have pasted it below. Before that: I just realized that location /weblog/ { rewrite ^/(.*)$ /blog/$1 permanent; } was actually not even giving me the root of /blog/ (I had left in the old statement as well). It actually returns: /blog/weblog which is a 404. Anyway, on to the server statementsby miles - Nginx Mailing List - English
location /weblog/ { rewrite ^/(.*)$ /blog/$1 permanent; } Thanks, meto! I had tried that as well (sorry for not posting all of the regular expressions I tried - I lost track of them all), but it has the same effect; i.e., everything still redirects to the /blog index page, even links like /weblog/foo.html, /weblog/bar/, etc.by miles - Nginx Mailing List - English
I have moved my blog from /weblog to /blog. How can I redirect all requests for /weblog and its files to /blog? I have tried: location /weblog/ { rewrite ^ /blog/ permanent; } but that pushes all /weblog/ requests to the /blog/ index page, including /weblog/foo, /weblog/bar.html, etc. I have tried a number of regex expressions, but so far none has worked as expected. Could someone pby miles - Nginx Mailing List - English