if i get a url like this
/123456/xxxx
will nginx be able to rewrite the url to:
/xxxx?id=123456
if so how can i do it?
thansk a lot!!
if i get a url like this
/123456/xxxx
will nginx be able to rewrite the url to:
/xxxx?id=123456
if so how can i do it?
thansk a lot!!
rewrite ^/(\d+)/(.+) /$2?id=$1 last;
more or less. although you’d probably want to make it /123456/xxxx/ -
without the delimiter the url can be anything really.
Hi Michael,
Thanks a lot for this. Yes you are right, i think i need this
/123456/xxxx/
in that case, is the following correct?
rewrite ^/(\d+)/(.+)/ /$2?id=$1 last;
can you explain what the word last means?
thanks a lot!
means it will not process any further rewrites
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs