• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

I need help with nginx redirect (duplicated content problem)


Well-known member
Hello. In my forum I put the Resource Manager as the main page and later I realised that it was not a good idea so I changed it to /resources, so the forum at /.

Now I have a problem with duplicated content from the resources pagination.


Redirect http://example.com/?page=1 to http://example.com/resources/?page=1

Please, can you help me redirecting these urls in order to remove this duplicated content URLS? I'm using Nginx 1.2.1

Any idea on why this doesn't work?
rewrite ^/?page=(.*)$ /resources/?page=$1 permanent;
This (inside location / { }) "works" but it falls in a loop:
if ($arg_page) { return 301 http://example.com/resources/?page=$arg_page; }

With this (inside location /) at least I avoid duplicated content problem:
if ($arg_page) {  return 301 https://example.com/anuncios/;  }
Last edited: