0

I want to change the url: www.example.com/index.html?id=roy to: www.example.com/roy

I have tried this solution, but it is for the url: www.example.com/users/roy

Community
  • 1
  • 1

3 Answers3

0

Please give this a try. This rewrites /(.+) to /index.html?id=$1.

rewrite ^/(.+)$ /index.html?id=$1 last;
Tan Hong Tat
  • 6,671
  • 2
  • 27
  • 25
0

i solved the problem: try_files $uri/ $uri /index.html?$query_string

0

try this, (use of infinite names)

location / {
  rewrite ^ http://www.example.com/users/$arg_id permanent;
}
Satys
  • 2,319
  • 1
  • 20
  • 26