How to Pass HTTP GET Parameters in Slashes

Asked 2 years ago, Updated 2 years ago, 60 views

What should I set to pass the get URL parameter in slash?
www.example.com/?id=1
I would like to do the above as follows.
www.example.com/id/1
The language is php and the server is nginx.

I would appreciate it if you could let me know the details.
Thank you for your cooperation.

php nginx

2022-09-30 20:58

1 Answers

Defining rewrite settings on nginx should solve this problem.

Example)

 rewrite^/(.*)/(.*)$/?$1 = $2 last;

(I didn't actually move it)

https://yhmwss.yhm.kyocera.co.jp/android/default.aspx

There is no need to make any changes to the PHP side as long as it is operating below.
www.example.com/?id=1


2022-09-30 20:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.