Re: rewriting $arg into request.

2020-01-31 Thread Steve Wilson
On 31/01/2020 12:37, Reinis Rozitis wrote: if ($arg_p) { return 301http://yoursite/p/$arg_p; } This is what I was originally looking for, however as I've only 20 pages to manage the individual redirects via the map directive I believe will work better as it will remove a additional r

Re: rewriting $arg into request.

2020-01-31 Thread Francis Daly
On Fri, Jan 31, 2020 at 12:11:54PM +, Steve Wilson wrote: Hi there, > Hugo's alias basically creates a /alias/index.html file which contains a > meta refresh. Ah, ok. Presumably there would have to be some web server config needed to make the incoming request actually serve that file -- I th

RE: rewriting $arg into request.

2020-01-31 Thread Reinis Rozitis
> > 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

Re: rewriting $arg into request.

2020-01-31 Thread Steve Wilson
Hugo's alias basically creates a /alias/index.html file which contains a meta refresh. I managed to find something using an if which does the job, however using the map solution presented is much more elegant as it would reduce the redirects.     if ($args ~ "^p=(\d+)") {  

Re: rewriting $arg into request.

2020-01-31 Thread Francis Daly
On Fri, Jan 31, 2020 at 01:13:30AM +, Steve Wilson wrote: Hi there, > Currently wordpress is using ugly urls for posts, so "/?p=1234" in wordpress > might be "/this_nice_title" in hugo. > Now hugo allows me to specify aliases too which I'd like to leverage to > maintain links, but this is whe