> > if ($args ~ "^p=(\d+)") { > set $page $1; > set $args ""; > rewrite ^.*$ /p/$page last; > break; > } > > I knew there'd be a simpler way and I due to the time of night I was > struggling.
To add to this (and the map variant by Francis) if the parameter is always 'p' you can just use $arg_p rather than regex on $args or whole $request_uri: if ($arg_p) { return 301 http://yoursite/p/$arg_p; } or map $arg_p $hugo_url { 1234 /this_nice_title; } ... rr _______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx