redirect question (inception inside)

Edho Arief me at myconan.net
Sat Aug 16 08:52:17 UTC 2014


On Sat, Aug 16, 2014 at 5:27 PM, Ronald Van Assche <rva at onvaoo.com> wrote:
> I want to redirect /us/us/directory/filename to the /us/directory/filename directory on my Nginx server.
>
> but this
>
>         if ( $request_filename ~ /us/us/.+ ) {
>                 rewrite ^(.*) http://mysiteurlt/us/$1 permanent;
>         }
>
> wont work.
>
> How can i redirect or rewrite such url  ?

location ^~ /us/us/ {
  rewrite ^/us(/us/.*) $1 permanent;
}



More information about the nginx mailing list